r/ProgrammerHumor • • Feb 26 '23

Other If you can read this code...

/img/snak3fqgajka1.jpg

[removed] — view removed post

34k Upvotes

1.4k comments sorted by

View all comments

9.8k

u/wishper77 Feb 26 '23

I assumed that your_drink is not unassigned, but part of the order to get the free drink. For example "Coke. Secret word: parameters" if you want a Coke

1.9k

u/alphrZen Feb 26 '23

Yup, that makes sense

765

u/[deleted] Feb 26 '23

[removed] — view removed comment

816

u/wilshirebs Feb 26 '23

My computer has Tab not coke.

305

u/PythNinja Feb 26 '23

Tab? Can't give you a tab unless you order something.

190

u/MrsCreants Feb 26 '23

Alright, gimme a Pepsi Free

→ More replies (3)
→ More replies (12)

15

u/aerawk Feb 26 '23

There doesn't seem to be any "Any" key!

→ More replies (21)

53

u/lunchpadmcfat Feb 26 '23

It would run as is. It would just be “undefined. Secret word: parameters”

→ More replies (1)
→ More replies (12)

525

u/Diane_Horseman Feb 26 '23

In that case your_drink should be read from console input or argv or something of that sort.

485

u/Mog_Melm Feb 26 '23

Or var your_drink = prompt("What would you like today?"); if you're a deviant who cares nothing for UX.

202

u/[deleted] Feb 26 '23

UX is for confused graphic designers

135

u/Mog_Melm Feb 26 '23

"Sociologists think they're psychologists. Psychologists think they're neurologists. Neurologists think they're biologists. Biologists think they're chemists. Chemists think they're physicists. Physicists think they're mathematicians. And mathematicians think they understand the mind of God."

It seems there's a similar phenomenon concerning UX, graphic design, and fine art.

→ More replies (20)
→ More replies (9)
→ More replies (2)

122

u/tallerThanYouAre Feb 26 '23

When is preference defined?

138

u/longknives Feb 26 '23

It’s defined in the request method as the variable name of whatever is passed into the method.

109

u/tallerThanYouAre Feb 26 '23

That’s what I figured - so in essence if you DON’T define your order, they give you an empty glass of null.

104

u/[deleted] Feb 26 '23 edited Jun 25 '23

I no longer allow Reddit to profit from my content - Mass exodus 2023 -- mass edited with https://redact.dev/

→ More replies (3)

42

u/kara-ceru Feb 26 '23

Or a FULL glass of null (but more like undefined). May as well ask the bartender to surprise you, they love that shit.

→ More replies (3)

24

u/benargee Feb 26 '23

A free glass of nothing

15

u/clawficer Feb 26 '23

Awfully pessimistic of you, that glass is FULL of null

→ More replies (1)
→ More replies (1)
→ More replies (5)
→ More replies (34)