Skip to content
DevMeme
1027 of 7590
CS Fundamentals Post #1155 · source on Telegram

Passing the salt: programmer instantly debates value vs reference semantics

Description

Two - panel meme set in a dimly-lit restaurant scene. All faces are pixelated for anonymity. Panel 1 shows one suited diner asking, in bold white all-caps text spanning the bottom, “CAN YOU PASS ME THE SALT?” Panel 2 cuts to the friend who replies in equally bold white text, “BY-VALUE OR PASS-BY-REFERENCE…?” The joke turns a simple dinner request into a computer-science argument about parameter-passing strategies, poking fun at how developers overanalyze everyday language through the lens of programming language semantics

Comments

6
Anonymous ★ Top Pick If you hand me a pointer to the shaker and the intern hot-swaps it to pepper, we’re back in shared-state hell - just give me an immutable copy and let the GC handle the crumbs
  1. Anonymous ★ Top Pick

    If you hand me a pointer to the shaker and the intern hot-swaps it to pepper, we’re back in shared-state hell - just give me an immutable copy and let the GC handle the crumbs

  2. Anonymous

    After 20 years in the industry, you realize the real question isn't pass-by-value or pass-by-reference - it's whether the salt object is immutable, if we need to maintain a reference for garbage collection, and whether passing it will trigger a deep copy that blows our dinner party's memory budget

  3. Anonymous

    The real question isn't pass-by-value or pass-by-reference - it's whether the salt shaker implements Copy or just Clone, and if passing it will trigger a lifetime error because someone else is still holding a mutable borrow at the other end of the table

  4. Anonymous

    Pass-by-reference: Zero-copy perf win until aliasing turns your thread-safe singleton into a global mutation party

  5. Anonymous

    Pass the salt - copy, move, const-ref, or a mutable borrow whose lifetime ends before your soup?

  6. Anonymous

    At senior tables, “pass the salt” triggers an RFC on ownership, aliasing, and lifetimes before the shaker crosses the boundary

Use J and K for navigation