Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: Classic WTF: When it’s OK to GOTO

      June 25, 2025

      Overture Maps launches GERS, a system of unique IDs for global geospatial entities

      June 25, 2025

      Agent Mode for Gemini added to Android Studio

      June 24, 2025

      Google’s Agent2Agent protocol finds new home at the Linux Foundation

      June 23, 2025

      Microsoft is reportedly planning yet more major cuts at Xbox — as early as next week

      June 24, 2025

      Microsoft makes Windows 10 security updates FREE for an extra year — but there’s a catch, and you might not like it

      June 24, 2025

      “Deus Ex” just turned 25 years old and it’s still the best PC game of all time — you only need $2 to play it on practically anything

      June 24, 2025

      Where to buy a Meta Quest 3S Xbox Edition — and why it’s a better bargain than the “normal” Meta Quest 3S

      June 24, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Generate awesome open graph images with Open Graphy

      June 25, 2025
      Recent

      Generate awesome open graph images with Open Graphy

      June 25, 2025

      Defining a Dedicated Query Builder in Laravel 12 With PHP Attributes

      June 25, 2025

      pxlrbt/filament-activity-log

      June 25, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Linux Jargon Buster: What are Secure Boot & Shim Files?

      June 25, 2025
      Recent

      Linux Jargon Buster: What are Secure Boot & Shim Files?

      June 25, 2025

      Fldigi – modem program for most of the digital modes used by radio amateurs

      June 25, 2025

      Lwan is an experimental, scalable, high performance HTTP server

      June 25, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Tech & Work»CodeSOD: Classic WTF: When it’s OK to GOTO

    CodeSOD: Classic WTF: When it’s OK to GOTO

    June 25, 2025

    Where did you GOTO on your vacation? Nowhere. GOTO is considered harmful. Original —Remy

    Everybody knows that you should never use “goto” statements. Well, except in one or two rare circumstances that you won’t come across anyway. But even when you do come across those situations, they’re usually “mirage cases” where there’s no need to “goto” anyway. Kinda like today’s example, written by Jonathan Rockway’s colleague. Of course, the irony here is that the author likely tried to use “continue” as his label, but was forced to abbreviate it to “cont” in order to skirt compiler “reserved words” errors.

    while( sysmgr->getProcessCount() != 0 )
    {
      // Yes, I realize "goto" statements are considered harmful,
      // but this is a case where it is OK to use them
      cont:
    
      //inactivation is not guaranteed and may take up to 3 calls
      sysmgr->CurrentProcess()->TryInactivate();
      
      if( sysmgr->CurrentProcess()->IsActive() )
      {
        Sleep(DEFAULT_TIMEOUT);
        goto cont;
      }
    
      /* ED: Snip */
    
      //disconnect child processes
      if( sysmgr->CurrentProcess()->HasChildProcesses() )
      {
        /* ED: Snip */
      }
    
      /* ED: Snip */
       
      if( sysmgr->CurrentProcess()->IsReusable() )
      {
        sysmgr->ReuseCurrentProcess();
        goto cont;
      }  
    
      sysmgr->CloseCurrentProcess();
    
    }
    [Advertisement]
    ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

    Source: Read More 

    news
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleOverture Maps launches GERS, a system of unique IDs for global geospatial entities
    Next Article pxlrbt/filament-activity-log

    Related Posts

    Tech & Work

    Overture Maps launches GERS, a system of unique IDs for global geospatial entities

    June 25, 2025
    Tech & Work

    Agent Mode for Gemini added to Android Studio

    June 24, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-48342 – RedefiningTheWeb Dynamic Pricing & Discounts Lite for WooCommerce CSRF Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    A Comprehensive Guide to LLM Routing: Tools and Frameworks

    Machine Learning

    CVE-2025-5080 – Tenda FH451 Stack-Based Buffer Overflow

    Common Vulnerabilities and Exposures (CVEs)

    Patch your Windows PC now before bootkit malware takes it over – here’s how

    News & Updates

    Highlights

    ADIF Multitool – validate, modify and convert ham radio log files

    June 15, 2025

    ADIF Multitool is a command-line tool to validate, modify, and convert ham radio log files.…

    CVE-2025-4492 – Campcodes Online Food Ordering System SQL Injection Vulnerability

    May 9, 2025

    Microsoft Edge for Business Now Lets Admins Push Encrypted Passwords to Users Securely

    June 19, 2025

    CVE-2025-32705 – Microsoft Office Outlook Out-of-bounds Read Remote Code Execution Vulnerability

    May 13, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.