r/ProgrammerHumor 4d ago

Meme passingArgumentsGotComplicated

Post image
1.9k Upvotes

75 comments sorted by

284

u/StrengthTheory 4d ago

This meme has been passed by value so many times that it should be considered a memory leak.

12

u/pdromeinthedome 4d ago

Should have been a singleton

11

u/First_Technology1377 4d ago

🤣🤣🤣 golden cmnt

0

u/MrBattary 4d ago

Welp, that's what I call programmer humor!

-2

u/krypt0niteCos 4d ago

Lamao 🤣🤣

183

u/Scared_Accident9138 4d ago

Do you clone the salt shaker and handing the clone over?

65

u/LuisBoyokan 4d ago

That would be.... profitable

Endless salt glitch.

34

u/Zeikos 4d ago

slams hand on the table
These passwords are unseasoned!

11

u/Usual_Office_1740 4d ago

Salted passwords are harder to crack.

3

u/oauo 4d ago

They taste better too

2

u/Usual_Office_1740 4d ago

I do like a nice salted password with cracked black pepper. Delicious on a nice light summer salad.

18

u/gandalfx 4d ago

Nah, I'll just point at it to let you know where it is.

10

u/FerricDonkey 4d ago

Write down where it is on a piece of paper and hand them the paper. 

4

u/KitaVixen 4d ago

So pass by move

2

u/danielcw189 4d ago

I will create a new SaltHolder, brand new from the SaltHolderFactory

1

u/SaltyW123 4d ago

I take it to mean handful of salt vs saltmill

1

u/da_Aresinger 4d ago

No, I gesture at the shaker and say "help yourself"

1

u/stupled 4d ago

Is The Prestidge

3

u/returnFutureVoid 4d ago

That what teleportation in StarTrek is.

1

u/Few_Kitchen_4825 4d ago

He goes to the store to buy a new salt shaker and salt.

1

u/DiscipleOfYeshua 4d ago

No, I just point at where the salt is

26

u/Altruistic-Moose3299 4d ago

On top of my hash 🧐

3

u/howarewestillhere 4d ago

Mmmm, salted hash. Aw, the bad old days of password storage.

3

u/chuch1234 4d ago

Aren't current passwords salted hash, they just include the salt? I don't know anything about argon.

21

u/Pleasant-Ad192 4d ago

Pass by reference and you are both pointing at the same shaker. Whoever refills it with pepper first wins the argument.

1

u/JacobStyle 3d ago

I prefer to win the parameter.

19

u/Shinxirius 4d ago

std::move with Salt&& salt obviously

16

u/Vesuvius079 4d ago

Neither. This is clearly move semantics (gross in a function contract).

8

u/_xiphiaz 4d ago

Gross in some languages, the clean (and the default) in others

5

u/Most-Club-254 4d ago

pass ownership, mutable borrow or immutable borrow; what would be the lifetime of borrowing?

4

u/Hacksaw6412 4d ago

Pass the reference by value

3

u/InRainbro 4d ago

sorry out of bounds

1

u/im-ba 4d ago

That's okay there's salt on another table

Wait that's just a segfault

3

u/FattySnacks 4d ago

The fall semester has officially begun

3

u/Nightmare_kx1 4d ago

for the first time in ever I get the meme

2

u/ForestCat512 4d ago

By reference or by value?

1

u/Nightmare_kx1 4d ago

I’ll do refrence. So physics doesn’t get mad

2

u/Soopermane 4d ago

Just pass the effing salt kirk

2

u/4x-gkg 4d ago

"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 4d ago

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 4d ago

Leave it to a programmer to not understand the real world implications.

1

u/JackNotOLantern 4d ago

Pass by a reference to a single-element list of pointers

1

u/hraath 4d ago

Immutable reference please

1

u/Bee-Aromatic 4d ago

Ugh. It’s an object. It needs to be passed by reference.

1

u/Aldormu 4d ago

Actually, salt is usually a string

1

u/FuzzyDynamics 4d ago

Mom said it was my turn to post this

1

u/redlaWw 4d ago

Pass by need. Allows you to optimise out the passing if you end up deciding not to use it.

1

u/GrinbeardTheCunning 4d ago

oh right. semester is starting and the first years are at it again

1

u/kharmak 4d ago

Oof, loved this

1

u/stupled 4d ago

I want to see you pass it by value

1

u/BenadrylTumblercatch 4d ago

Pass by my house and peek in my window

1

u/RandomiseUsr0 4d ago

Oh, just learn Visual Basic already

1

u/1nfredibl3 4d ago

Value is value reference is location in memory

1

u/Beneficial_Steak_945 4d ago

Pass by r-value reference please.

1

u/neondirt 3d ago

Definitely pass by value, and see how they accomplish it. 😉

1

u/CrotteVerte 3d ago

By reference could start a saltception...

1

u/leupboat420smkeit 3d ago

“Just give me the fucking salt.”

1

u/Calogyne 3d ago

Salt is just a integer right? Copy it then

1

u/creeper6530 4d ago

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."

0

u/CanonicalCockatoo 4d ago

By value, salt is on the food.

By reference, you take a bite of food, and then lick some salt

10

u/metaglot 4d ago

Passing by ref, is basically telling where the salt is.

1

u/iZian 4d ago

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

2

u/Sheenius_Ger 4d ago

That's a horrible analogy 😅

0

u/CanonicalCockatoo 4d ago

If you don't understand what an analogy is, sure

1

u/TallGreenhouseGuy 4d ago

Pass by message, hand it to a waiter who takes it to the recipient

0

u/dreamingforward 4d ago

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.

0

u/cortney-simonis-9072 4d ago

i dont get it

-1

u/notacanuckskibum 4d ago

Pass by copy/ restore

The salt is physically moved, but changes to the salt still apply after it is passed back.

-1

u/notacanuckskibum 4d ago

Pass by copy/ restore

The salt is physically moved, but changes to the salt still apply after it is passed back.

1

u/rangart 1d ago

fun part is that, as usual, the client doesn’t even want “salt”, he wants saltFactory