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

      The Psychology Of Color In UX Design And Digital Products

      August 15, 2025

      This week in AI dev tools: Claude Sonnet 4’s larger context window, ChatGPT updates, and more (August 15, 2025)

      August 15, 2025

      Sentry launches MCP monitoring tool

      August 14, 2025

      10 Benefits of Hiring a React.js Development Company (2025–2026 Edition)

      August 13, 2025

      I flew Insta360’s new ‘Antigravity’ drone around Los Angeles, and it was impossible to miss a shot

      August 15, 2025

      The $100 open-ear headphones that made me forget about my Shokz

      August 15, 2025

      5 quick and simple ways to greatly improve the quality of your headphones

      August 15, 2025

      Installing a UPS battery backup saved my work PC – here’s the full story

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

      Maintaining Data Consistency with Laravel Database Transactions

      August 16, 2025
      Recent

      Maintaining Data Consistency with Laravel Database Transactions

      August 16, 2025

      Building a Multi-Step Form With Laravel, Livewire, and MongoDB

      August 16, 2025

      Inertia Releases a New Form Component

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

      Google’s Gemini AI had a full-on meltdown while coding — calling itself a fool, a disgrace, and begging for freedom from its own loop

      August 15, 2025
      Recent

      Google’s Gemini AI had a full-on meltdown while coding — calling itself a fool, a disgrace, and begging for freedom from its own loop

      August 15, 2025

      Take-Two hints at $100 price tag for Grand Theft Auto VI — will it deliver on value?

      August 15, 2025

      ChatGPT Go offers GPT-5, image creation, and longer memory — all for $5 (if you’re lucky enough to live where it’s available)

      August 15, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: It’s Not Wrong to Say We’re Equal

    CodeSOD: It’s Not Wrong to Say We’re Equal

    July 1, 2025

    Aaron was debugging some C# code, and while this wasn’t the source of the bug, it annoyed him enough to send it to us.

    protected override int DoCompare(Item item1, Item item2)
    {
    	try
    	{
    		DateTime thisDate = ((DateField)item1.Fields["Create Date"]).DateTime;
    		DateTime thatDate = ((DateField)item2.Fields["Create Date"]).DateTime;
    
    		return thatDate.CompareTo(thisDate);
    	}
    	catch (Exception)
    	{
    		return 0; // Sorry, ran out of budget!
    	}
    }
    

    Not to be the pedantic code reviewer, but the name of this function is terrible. Also, DoCompare clearly should be static, but this is just pedantry.

    Now, there’s a lot of implied WTFs hidden in the Item class. They’re tracking fields in a dictionary, or maybe a ResultSet, but I don’t think it’s a ResultSet because they’re converting it to a DateField object, which I believe to be a custom type. I don’t know what all is in that class, but the whole thing looks like a mess and I suspect that there are huge WTFs under that.

    But we’re not here to look at implied WTFs. We’re here to talk about that exception handler.

    It’s one of those “swallow every error” exception handlers, which is always a “good” start, and it’s the extra helpful kind, which returns a value that is likely incorrect and provides no indication that anything failed.

    Now, I suspect it’s impossible for anything to have failed- as stated, this seems to be some custom objects and I don’t think anything is actively talking to a database in this function (but I don’t know that!) so the exception handler likely never triggers.

    But hoo boy, does the comment tell us a lot about the codebase. “Sorry, ran out of budget!”. Bugs are inevitable, but this is arguably the worst way to end up with a bug in your code: because you simply ran out of money and decided to leave it broken. And ironically, I suspect the code would be less broken if you just let the exception propagate up- if nothing else, you’d know that something failed, instead of incorrectly thinking two dates were the same.

    [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 ArticlePulp – skim excessive feeds
    Next Article CVE-2025-6934 – Opal Estate Pro – WordPress Property Management Plugin Privilege Escalation Vulnerability

    Related Posts

    News & Updates

    I flew Insta360’s new ‘Antigravity’ drone around Los Angeles, and it was impossible to miss a shot

    August 15, 2025
    News & Updates

    The $100 open-ear headphones that made me forget about my Shokz

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

    Google Docs Can Now Edit Encrypted Word Files But Only in Beta As Of Now

    Operating Systems

    What is Typecasting in Go? Explained with Code Examples

    Development

    CVE-2025-4112 – PHPGurukul Student Record System SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-54416 – GitHub tj-actions Branch Names Command Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-54368 – “uv ZIP Archive Extraction Vulnerability”

    August 7, 2025

    CVE ID : CVE-2025-54368

    Published : Aug. 8, 2025, 12:15 a.m. | 34 minutes ago

    Description : uv is a Python package and project manager written in Rust. In versions 0.8.5 and earlier, remote ZIP archives were handled in a streamwise fashion, and file entries were not reconciled against the archive’s central directory. An attacker could contrive a ZIP archive that would extract with legitimate contents on some package installers, and malicious contents on others due to multiple local file entries. An attacker could also contrive a “stacked” ZIP input with multiple internal ZIPs, which would be handled differently by different package installers. The attacker could choose which installer to target in both scenarios. This issue is fixed in version 0.8.6. To work around this issue, users may choose to set UV_INSECURE_NO_ZIP_VALIDATION=1 to revert to the previous behavior.

    Severity: 0.0 | NA

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-52842 – Laundry Cross-site Scripting (XSS)

    July 2, 2025

    CVE-2025-7028 – Apache Software SMI Handler Pointer Dereference Vulnerability

    July 11, 2025

    The one Android settings shortcut I can’t live without – and how to customize it

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

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