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

      Google integrates Gemini CLI into Zed code editor

      August 28, 2025

      10 Benefits of Integrating React.js Vibe Coding into Your Agile DevOps Pipeline

      August 28, 2025

      Designing For TV: The Evergreen Pattern That Shapes TV Experiences

      August 27, 2025

      Amplitude launches new self-service capabilities for marketing initiatives

      August 27, 2025

      This Vizio soundbar has impressive surround sound, and it’s on sale

      August 29, 2025

      DJI’s ultralight wireless Mic 3 captures great audio – even in tricky situations

      August 29, 2025

      OpenAI gives its voice agent superpowers to developers – look for more apps soon

      August 29, 2025

      T-Mobile will give you 4 free iPhone 16 phones right now – here’s how to get yours

      August 29, 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

      Optimizing Laravel Livewire Performance with Computed Properties

      August 29, 2025
      Recent

      Optimizing Laravel Livewire Performance with Computed Properties

      August 29, 2025

      Smart Cache Package for Laravel

      August 29, 2025

      This Week in Laravel: Filament 4 Videos and Pest 4 Browser Testing

      August 29, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Containers in 2025: Docker vs. Podman for Modern Developers

      August 29, 2025
      Recent

      Containers in 2025: Docker vs. Podman for Modern Developers

      August 29, 2025

      FOSS Weekly #25.35: New Gerhwin DE, grep Command, Nitro init system, KDE Customization and More Linux Stuff

      August 29, 2025

      19 Beautiful Themes to Get a Better Visual Experience With VS Code

      August 29, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»Representative Line: Springs are Optional

    Representative Line: Springs are Optional

    August 28, 2025

    Optional types are an attempt to patch the “billion dollar mistake“. When you don’t know if you have a value or not, you wrap it in an Optional, which ensures that there is a value (the Optional itself), thus avoiding null reference exceptions. Then you can query the Optional to see if there is a real value or not.

    This is all fine and good, and can cut down on some bugs. Good implementations are loaded with convenience methods which make it easy to work on the optionals.

    But then, you get code like Burgers found. Which just leaves us scratching our heads:

    private static final Optional<Boolean> TRUE = Optional.of(Boolean.TRUE);
    private static final Optional<Boolean> FALSE = Optional.of(Boolean.FALSE);
    

    Look, any time you’re making constants for TRUE or FALSE, something has gone wrong, and yes, I’m including pre-1999 versions of C in this. It’s especially telling when you do it in a language that already has such constants, though- at its core- these lines are saying TRUE = TRUE. Yes, we’re wrapping the whole thing in an Optional here, which potentially is useful, but if it is useful, something else has gone wrong.

    Burgers works for a large insurance company, and writes this about the code:

    I was trying to track down a certain piece of code in a Spring web API application when I noticed something curious. It looked like there was a chunk of code implementing an application-specific request filter in business logic, totally ignoring the filter functions offered by the framework itself and while it was not related to the task I was working on, I followed the filter apply call to its declaration.
    While I cannot supply the entire custom request filter implementation, take these two static declarations as a demonstration of how awful the rest of the class is.

    Ah, of course- deep down, someone saw a perfectly functional wheel and said, “I could make one of those myself!” and these lines are representative of the result.

    [Advertisement]
    Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Articlegofumpt – stricter gofmt
    Next Article Cloudreve – self-hosted file management system with multi-cloud support

    Related Posts

    News & Updates

    This Vizio soundbar has impressive surround sound, and it’s on sale

    August 29, 2025
    News & Updates

    DJI’s ultralight wireless Mic 3 captures great audio – even in tricky situations

    August 29, 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-46816 – “goshs Command Injection Vulnerability”

    Common Vulnerabilities and Exposures (CVEs)

    How to Build a Lean Security Model: 5 Lessons from River Island

    Development

    Mastering GitHub Copilot in VS Code

    Development

    CVE-2025-3806 – Dazhouda Lcms Cross Site Scripting Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    dizqueTV – create live TV channel streams from media on your Plex servers

    August 23, 2025

    dizqueTV lets you create live TV channel streams from media on your Plex servers. Configure…

    CVE-2025-4195 – iSourcecode Gym Management System SQL Injection

    May 2, 2025

    Powerful JavaScript Frameworks for Game Developers

    July 1, 2025

    CVE-2025-8330 – Code-projects Vehicle Management SQL Injection

    July 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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