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

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 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

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»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 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleRogue WordPress Plugin Unmasked: Stealthy Malware Skims Credit Cards & Steals Credentials
    Next Article CVE-2025-5585 – SiteOrigin Widgets Bundle Stored Cross-Site Scripting Vulnerability

    Related Posts

    News & Updates

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 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

    Russian Hackers Exploit Microsoft OAuth to Target Ukraine Allies via Signal and WhatsApp

    Development

    Filament v4 Beta Released: 4 New Features You Need to Know

    Development
    How to Extend the Django User Model

    How to Extend the Django User Model

    Development

    CVE-2025-47584 – ThemeGoods Photography Deserialization of Untrusted Data Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    NVIDIA_OC overclocks NVIDIA GPUs

    May 3, 2025

    NVIDIA_OC is a simple Rust Command-Line Interface tool designed to overclock NVIDIA GPUs on Linux.…

    CVE-2025-45872 – “zrlog SSRF”

    July 1, 2025

    CodeSOD: Pulling at the Start of a Thread

    May 1, 2025

    NVIDIA Releases Cosmos-Reason1: A Suite of AI Models Advancing Physical Common Sense and Embodied Reasoning in Real-World Environments

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

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