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

      The Ultimate Guide to Node.js Development Pricing for Enterprises

      July 29, 2025

      Stack Overflow: Developers’ trust in AI outputs is worsening year over year

      July 29, 2025

      Web Components: Working With Shadow DOM

      July 28, 2025

      Google’s new Opal tool allows users to create mini AI apps with no coding required

      July 28, 2025

      I replaced my Samsung OLED TV with this Sony Mini LED model for a week – and didn’t regret it

      July 29, 2025

      I tested the most popular robot mower on the market – and it was a $5,000 crash out

      July 29, 2025

      5 gadgets and accessories that leveled up my gaming setup (including a surprise console)

      July 29, 2025

      Why I’m patiently waiting for the Samsung Z Fold 8 next year (even though the foldable is already great)

      July 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

      Performance Analysis with Laravel’s Measurement Tools

      July 29, 2025
      Recent

      Performance Analysis with Laravel’s Measurement Tools

      July 29, 2025

      Memoization and Function Caching with this PHP Package

      July 29, 2025

      Laracon US 2025 Livestream

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

      Microsoft mysteriously offered a Windows 11 upgrade to this unsupported Windows 10 PC — despite it failing to meet the “non-negotiable” TPM 2.0 requirement

      July 29, 2025
      Recent

      Microsoft mysteriously offered a Windows 11 upgrade to this unsupported Windows 10 PC — despite it failing to meet the “non-negotiable” TPM 2.0 requirement

      July 29, 2025

      With Windows 10’s fast-approaching demise, this Linux migration tool could let you ditch Microsoft’s ecosystem with your data and apps intact — but it’s limited to one distro

      July 29, 2025

      Windows 10 is 10 years old today — let’s look back at 10 controversial and defining moments in its history

      July 29, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Tangled Up in Foo

    CodeSOD: Tangled Up in Foo

    April 24, 2025

    DZ‘s tech lead is a doctor of computer science, and that doctor loves to write code. But you already know that “PhD” stands for “Piled high and deep”, and that’s true of the tech lead’s clue.

    For example, in C#:

    private List<Foo> ExtractListForId(string id)
    {
    	List<Foo> list = new List<Foo>();
    	lock (this)
    	{
    		var items = _foos.Where(f => f.Id == id).ToList();
    		foreach (var item in items)
    		{
    			list.Add(item);
    		}
    	}
    	return list;
    }
    

    The purpose of this function is to find all the elements in a list where they have a matching ID. That’s accomplished in one line: _foo.Where(f => f.Id == id). For some reason, the function goes through the extra step of iterating across the returned list and constructing a new one. There’s no real good reason for this, though it does force LINQ to be eager- by default, the Where expression won’t be evaluated until you check the results.

    The lock is in there for thread safety, which hey- the enumerator returned by Where is not threadsafe, so that’s not a useless thing to do there. But it’s that lock which hints at the deeper WTF here: our PhD-having-tech-lead knows that adding threads ensures you’re using more of the CPU, and they’ve thrown threads all over the place without any real sense to it. There’s no clear data ownership of any given thread, which means everything is locked to hell and back, the whole thing frequently deadlocks, and it’s impossible to debug.

    It’s taken days for DZ to get this much of a picture of what’s going on in the code, and further untangling of this multithreaded pile of spaghetti is going to take many, many more days- and much, much more of DZ’s sanity.

    [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleLinux Show Player is a cue player designed for stage productions
    Next Article CVE-2025-3761 – My Tickets – WordPress Privilege Escalation Vulnerability

    Related Posts

    News & Updates

    I replaced my Samsung OLED TV with this Sony Mini LED model for a week – and didn’t regret it

    July 29, 2025
    News & Updates

    I tested the most popular robot mower on the market – and it was a $5,000 crash out

    July 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

    Microsoft Copilot’s next big upgrade takes on NotebookLM and could save you hours of research time

    News & Updates

    Sequential-NIAH: A Benchmark for Evaluating LLMs in Extracting Sequential Information from Long Texts

    Machine Learning

    Microsoft finally integrates SharePoint eSignatures to Word

    Operating Systems

    Microsoft Authenticator won’t manage your passwords anymore – here’s why and what’s next

    News & Updates

    Highlights

    CVE-2025-7436 – Campcodes Online Recruitment Management System SQL Injection Vulnerability

    July 11, 2025

    CVE ID : CVE-2025-7436

    Published : July 11, 2025, 4:15 a.m. | 5 hours, 22 minutes ago

    Description : A vulnerability was found in Campcodes Online Recruitment Management System 1.0. It has been declared as critical. This vulnerability affects unknown code of the file /admin/ajax.php?action=delete_vacancy. The manipulation of the argument ID leads to sql injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.

    Severity: 7.3 | HIGH

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

    CVE-2025-20309 – Cisco Unified Communications Manager/Cisco Unified Communications Manager Session Management Edition Root Account Default Credential Vulnerability

    July 2, 2025

    CVE-2025-4504 – SourceCodester Online College Library System SQL Injection Vulnerability

    May 10, 2025

    CVE-2025-6974 – SOLIDWORKS eDrawings Uninitialized Variable Code Execution Vulnerability

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

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