"Whereas Europeans generally pronounce his name the right way ('Nick-louse Veert'), Americans invariably mangle it into 'Nickel's Worth.' This is to say that Europeans call him by name, but Americans call him by value."
Introduction by Adriaan van Wijngaarden at the IFIP Congress (1965).
If they go for pass-by-value and Di'caprio is done with it, they need to make the original disappear and be replaced by the now less salt from Di'caprio.
This is where CS terminology differs from common understanding.
Pass by reference would be sharing a map to where the salt is, and anyone able to change that map changes everyone’s understanding of where it is, even pointing the map to something else or a different shaker.
Most modern languages only pass references by their value.
That’s closer to “telling them” as in, you give them a copy of the reference which they can alter themselves. But you always know where that salt shaker is, even if they decide that shaker is empty and to go get a new one from elsewhere, you still look at your empty shaker because you have the reference with pass-by-value.
Reference types, python , Java, modern languages are pretty much all pass-by-value. References are the value. But it’s not pass by reference.
But in 2026 nobody cares. The reference is passed. But a copy of it. Not it.
Perhaps pass-by-reference is the better analogy for the shaker. If it’s replaced by a new one everyone should use the new one. Just, that isn’t how new languages work unless you wrap the reference in another object that’s shared
295
u/StrengthTheory Sep 05 '26 •
This meme has been passed by value so many times that it should be considered a memory leak.
186
u/Scared_Accident9138 Sep 05 '26
Do you clone the salt shaker and handing the clone over?
26
u/Altruistic-Moose3299 Sep 05 '26
On top of my hash 🧐
22
u/Pleasant-Ad192 Sep 05 '26
Pass by reference and you are both pointing at the same shaker. Whoever refills it with pepper first wins the argument.
19
u/Shinxirius Sep 05 '26
std::movewithSalt&& saltobviously16
u/Vesuvius079 Sep 05 '26
Neither. This is clearly move semantics (gross in a function contract).
6
u/Most-Club-254 Sep 05 '26
pass ownership, mutable borrow or immutable borrow; what would be the lifetime of borrowing?
3
u/letternumber-and_ Sep 05 '26
Passing the sauce instead:
3
u/InRainbro Sep 05 '26
sorry out of bounds
3
u/FattySnacks Sep 06 '26
The fall semester has officially begun
3
u/Nightmare_kx1 Sep 06 '26
for the first time in ever I get the meme
2
u/Soopermane Sep 05 '26
Just pass the effing salt kirk
2
u/4x-gkg Sep 05 '26
"Whereas Europeans generally pronounce his name the right way ('Nick-louse Veert'), Americans invariably mangle it into 'Nickel's Worth.' This is to say that Europeans call him by name, but Americans call him by value."
Introduction by Adriaan van Wijngaarden at the IFIP Congress (1965).
2
u/Phioreable Sep 06 '26
If they go for pass-by-value and Di'caprio is done with it, they need to make the original disappear and be replaced by the now less salt from Di'caprio.
1
u/howarewestillhere Sep 05 '26
Leave it to a programmer to not understand the real world implications.
1
u/JackNotOLantern Sep 05 '26
Pass by a reference to a single-element list of pointers
1
u/hraath Sep 05 '26
Immutable reference please
1
u/Bee-Aromatic Sep 05 '26
Ugh. It’s an object. It needs to be passed by reference.
1
u/FuzzyDynamics Sep 05 '26
Mom said it was my turn to post this
1
u/Walt925837 Sep 05 '26
lol
1
u/redlaWw Sep 05 '26
Pass by need. Allows you to optimise out the passing if you end up deciding not to use it.
1
u/GrinbeardTheCunning Sep 06 '26
oh right. semester is starting and the first years are at it again
1
u/kharmak Sep 06 '26
Oof, loved this
1
u/stupled Sep 06 '26
I want to see you pass it by value
1
u/BenadrylTumblercatch Sep 06 '26
Pass by my house and peek in my window
1
u/RandomiseUsr0 Sep 06 '26
Oh, just learn Visual Basic already
1
u/Few_Kitchen_4825 Sep 06 '26
1
u/1nfredibl3 Sep 06 '26
Value is value reference is location in memory
1
u/Beneficial_Steak_945 Sep 06 '26
Pass by r-value reference please.
1
u/neondirt Sep 06 '26
Definitely pass by value, and see how they accomplish it. 😉
1
u/CrotteVerte Sep 06 '26
By reference could start a saltception...
1
u/leupboat420smkeit Sep 07 '26
“Just give me the fucking salt.”
1
u/Calogyne Sep 07 '26
Salt is just a integer right? Copy it then
1
u/rangart Sep 08 '26
fun part is that, as usual, the client doesn’t even want “salt”, he wants saltFactory
1
u/vardubs Sep 11 '26
Dont pass the salt, instead think about my plate by reference and sprinkle some salt by value and forget about my plate.
1
u/creeper6530 Sep 05 '26
Pass by value: handing the salt shaker over, either by moving it or making a copy (depends on language)
Pass by reference: "It's over there, get it yourself."
-1
u/CanonicalCockatoo Sep 05 '26
By value, salt is on the food.
By reference, you take a bite of food, and then lick some salt
0
u/dreamingforward Sep 05 '26
You either pass a value that is under a word-size. OR you pass a pointer that points to a larger structure.
That's all you need to know. Somewhere CS or C got confused. It also only takes ONE symbol ("*") to make it ALL work.
-1
u/notacanuckskibum Sep 05 '26
Pass by copy/ restore
The salt is physically moved, but changes to the salt still apply after it is passed back.
-1
u/notacanuckskibum Sep 05 '26
Pass by copy/ restore
The salt is physically moved, but changes to the salt still apply after it is passed back.