Logo
The first computer bug was literally a moth.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Heap-vs-stack Memes

Posts tagged with Heap-vs-stack

No Heap All Stack

Csharp Programming Backend
3 months ago 58.1M views 1 shares
No Heap All Stack
When you're comparing strings and you think == will do the job because both strings are "obviously the same," only to discover that string interning and reference equality have other plans. The top panel shows the naive approach using ToLower() on both sides with reference equality—spoiler alert: it creates new string objects on the heap, so they're different references even if the content matches. The bottom panel is the enlightened developer who discovered string.Equals() with StringComparison.OrdinalIgnoreCase —the proper way to do case-insensitive string comparison without allocating unnecessary objects. No heap allocations for temporary lowercase strings, just pure stack-based comparison logic. Your garbage collector will thank you, and your code reviews will be 10% less painful.

Today's picks

Where's The Love

Where's The Love

Programming
149.4M views 7 days ago
Murdered by words, programming edition

Murdered by words, programming edition

Programming
164.4K views 3 years ago
Elgato XLR Dock MK.2 for Stream Deck +, Audio Interface

Elgato XLR Dock MK.2 for Stream Deck +, Audio Interface

Affiliate
$129.99