Logo
The first computer mouse had only one button.
  • 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
4 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

Apple MacBook Pro 2021 with Apple M1 Pro chip (14-inch, 16GB RAM, 512GB SSD) - Space Gray (Renewed)

Apple MacBook Pro 2021 with Apple M1 Pro chip (14-inch, 16GB RAM, 512GB SSD) - Space Gray (Renewed)

Affiliate
$698.00
Ok Fine Dad Its Weed Js

Ok Fine Dad Its Weed Js

Javascript
184.6K views 1 year ago
Credit in comments(also I don't think it has been posted here, sorry if I'm wrong)

Credit in comments(also I don't think it has been posted here, sorry if I'm wrong)

Programming
99.5K views 3 years ago