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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 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 power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»CodeSOD: Broken Loop

    CodeSOD: Broken Loop

    June 13, 2024

    Kyle sends us a puzzler of bad code today. It appears in a “JSP-like” codebase- which Kyle provides no futher details on, but certainly hints at a serious WTF underpinning this code.

    boolean loop = true;
    while (loop) {
    // fake loop to break out of
    loop = false;
    doesStuff();
    moreStuff();
    etc();
    }

    This is a representative block, as this pattern appears frequently in the code. The comment fake loop to break out of is part of the code- it’s copypasted everywhere this particular pattern is used. In no instance is the variable loop ever changed– we enter the loop, set it to false, and then execute our code.

    My suspicion about the purpose is that it’s meant to easily disable blocks of code- change the first line to boolean loop = false and you effectively skip the block. But if that were the case, a conditional statement would do the job just as well. There’s no reason to use a loop. And even if that were the case, that’s a huge code-smell, anyway. Is it some misguided attempt at error handling? A misguided attempt at some kind of optimization, somehow? A ritual performed for no reason other than someone decided to do it that way one day, and just kept doing it forever after?

    Oh, right, it was written by the kind of person that has a “JSP-like” codebase, implying some sort of inner platform, home-grown, monstrosity. Yeah, that probably explains it.


    [Advertisement]
    BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleOpenAI reportedly uses Microsoft Azure to power Apple’s new AI features exclusively. Are the promised privacy and security still part of the package?
    Next Article Get the PDF Tool That Makes Your Work Easy for Just $30 Through 6/17

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2024-47893 – VMware GPU Firmware Memory Disclosure

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    5 TED Talks by Ethical Hackers that Will Change How You See Cybersecurity

    Development

    CVE-2025-4647 – Centreon Web Cross-Site Scripting (XSS)

    Common Vulnerabilities and Exposures (CVEs)

    UC Berkeley Researchers Released Sky-T1-32B-Preview: An Open-Source Reasoning LLM Trained for Under $450 Surpasses OpenAI-o1 on Benchmarks like Math500, AIME, and Livebench

    Machine Learning

    4 Ways to Fix Epson Perfection V39 II Not Working

    Development

    Highlights

    BBC Uses AI to Resurrect Agatha Christie as Your Personal Writing Coach

    May 1, 2025

    BBC Studios and the Agatha Christie estate just pulled off something straight out of a…

    Cyber Incident Shuts Down North Miami City Hall: What You Need to Know

    August 8, 2024

    Kryptor – simple, modern, and secure file encryption and signing tool

    February 2, 2025

    Weekly JavaScript Roundup: Friday Links 10

    November 8, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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