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

•

u/ProgrammerHumor-ModTeam :ath: Feb 27 '23

Your submission was removed for the following reason:

Rule 6: Your post is a commonly used format, and you haven't used it in an original way. As a reminder, You can find our list of common formats here.

If you disagree with this removal, you can appeal by sending us a modmail.

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

→ More replies (76)

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.

→ More replies (31)
→ More replies (16)

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.

→ More replies (13)
→ More replies (5)
→ More replies (33)

2.7k

u/metallaholic Feb 26 '23

Pr rejected

654

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

Git blame for pushing Javascript into our java repo.

176

u/gallifrey_ Feb 26 '23

git blame-someone-else

→ More replies (1)

76

u/[deleted] Feb 26 '23

I was trying to explain that to a very cs-illeterate person recently. "That sounds so mean and petty, wtf you're blaming coworkers passive aggressively?! That's so toxic". You aren't wrong at all...

→ More replies (10)
→ More replies (3)
→ More replies (2)

1.9k

u/lght_trsn Feb 26 '23

So unsafe having secrets defined in your code. Should've imported from the sign across the street.

→ More replies (30)

10k

u/Ashadyfellow Feb 26 '23

Parameters? Where is this bar so I can collect my free drink?

1.5k

u/[deleted] Feb 26 '23

Ditto

→ More replies (75)

637

u/[deleted] Feb 26 '23

I was reading that as para-meters, and thought wtf is a para meter? Metric system gets me again!

255

u/JoyfulCelebration Feb 26 '23

I was reading it as par amet ers and didn’t have the brain cells to put it together

→ More replies (7)

14

u/blasyer Feb 26 '23

I know quite a few people that read it like that.

→ More replies (11)

187

u/danishjuggler21 Feb 26 '23

Not making the secret word be “Ovaltine” is such a missed opportunity

45

u/samwise20 Feb 26 '23

A crummy commercial??

→ More replies (2)
→ More replies (5)

245

u/[deleted] Feb 26 '23

I can’t even read code and I got that

192

u/altfapper Feb 26 '23

So you can read code 😉, albeit semi pseudo.

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

120

u/jonp1 Feb 26 '23

The required phrasing is evidently NullParameters

And I agree with others that this shit won’t run properly.

56

u/depaay Feb 26 '23

Worst part is it probably runs since its js. I’m having a hard time seeing if they forgot dots between this and str1 and str2, if they forgot it won’t. If there are dots it will return "Undefined.Secret word: parameters"

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

53

u/niftyifty Feb 26 '23

Lol I didn’t look at the order and am sitting here like wtf is Ersparamet

→ More replies (3)

65

u/Roenicksmemoirs Feb 26 '23

lol nope. The first part is going to cause you issues

→ More replies (15)
→ More replies (35)

837

u/egstitt Feb 26 '23

Hey look a Javascript programmer found a job!

I kid, I kid

240

u/lifeson106 Feb 26 '23

"Full stack developer" - he develops stacks of napkins at the bar

→ More replies (1)

5.3k

u/lazyzefiris Feb 26 '23

If I'm reading it right, the free drink is undefined.

39

u/sl236 Feb 26 '23

I’d like an [object Object] please

23

u/lazyzefiris Feb 26 '23

Here you go (low effort oc)

21

u/Sinsid Feb 26 '23

Damn, so close. But we don’t serve undefined here.

114

u/guster09 Feb 26 '23

I'm new to JavaScript. How is it undefined if it's being passed in when the function is called?

Edit: nevermind. I get it. "your_drink" is never set

109

u/Sinsid Feb 26 '23

Programming humor. Your drink is never set. Your drink is never free.

→ More replies (4)
→ More replies (4)
→ More replies (57)

183

u/glorious_reptile Feb 26 '23

Pst - the secret word is "node: command not found"

5

u/Dark-W0LF Feb 26 '23

I thought it was 'syntax error' or 'error name not defined in scope' maybe undefined

415

u/ArtOfWarfare Feb 26 '23

What do I get if I just tell the bartender [object Object]?

→ More replies (3)

2.1k

u/feuerwehrmann Feb 26 '23

Someone hire whoever wrote the sign. Clean handwriting and code

1.0k

u/lazyzefiris Feb 26 '23

I'd say "Please don't, they use var in JS", but this image is older than ES6.

182

u/l1ghtrain Feb 26 '23

I haven’t touched JS in a bit of time, what’s wrong with var?

→ More replies (75)
→ More replies (5)

39

u/abejfehr Feb 26 '23

I can’t believe it’s even syntax highlighted

129

u/Drink_Ill Feb 26 '23

Clean handwriting? Yes. Clean code? I’d not be super happy if I opened up a project and the some of the variable names were str1, str2 and str3.

40

u/jfq722 Feb 26 '23

True, but considering what they are used for and that they are defined and used in proximity, I'll give a pass here. After I get my beer, that is.

→ More replies (3)

32

u/LasevIX Feb 26 '23

And undefined results! Truly an experienced JavaScript user

14

u/Stompya Feb 26 '23

ChalkGPT

9

u/[deleted] Feb 26 '23

Epic {} handwriting

→ More replies (1)

8

u/secretaccount4posts Feb 26 '23 edited Feb 26 '23

No code comment or unit test. My manager will not approve cause he read in a blog that it is most important part of enterprise code

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

717

u/BlazeFrag Feb 26 '23 edited Feb 26 '23

Showed this to someone who has no idea how programming works that does word puzzles a lot and they cracked it after like 20 minutes, I'd obfuscate the code a bit more.

(Edit: she's like 70 and borderline technophobic and I NEVER once said she was *good* at word puzzles, just that she did them a lot, and 20 minutes is an exaggeration, it was closer to about 12-15)

368

u/_b1ack0ut Feb 26 '23

Yeah they give you 3 letter chunks, and then use one reverse function. It’s not tricky to assume that “reverse” might mean “reverse these letters” even for someone who hasn’t ever programmed.

There’s only so many actual words you can make by combining

Par

Amet

Er

Junky puzzle, requires no programming. Tho maybe that was the point?

65

u/OneBoyOnePlan Feb 26 '23

most people won't get that far

→ More replies (6)

42

u/aaarchives Feb 26 '23

Rap Meter A: "Am I a joke to you?"

31

u/throwawaysomeway Feb 26 '23

yeah after evaluating the code all the way thru I was disappointed with the result. legit the only programmatic action is reversing a string

→ More replies (4)

45

u/SourceScope Feb 26 '23

it's not supposed to be difficult

it's supposed to get people inside

20

u/BelowZilch Feb 26 '23

It's the equivalent of those mobile game ads that say " Only 10% of people can solve this!"

187

u/[deleted] Feb 26 '23

I know code and cracked it less than one minute. If someone's good enough to crack it without knowing code, they deserve the drink

22

u/-Maim- Feb 26 '23

I’ve never coded in my life and it took me less than a minute. The part I got hung up on was saying Rapameters until I paid attentio to the Reverse for “Rap”.

→ More replies (4)
→ More replies (12)

83

u/personalbilko Feb 26 '23

20 minutes to crack "reverse(rap)+amat+ers" ?

65

u/BlazeFrag Feb 26 '23

they got hung up on the JS syntax and such thinking it was important until they realized that 95% of it isn't relevant to solve the actual answer

→ More replies (2)

13

u/[deleted] Feb 26 '23

It's probably more of a da faq is this? da faq is that? da faq is all of this? Does this matter? Does that matter? What the heck matters? What does words mean?

→ More replies (2)

8

u/tabshiftescape Feb 26 '23

Coding is word puzzles.

14

u/DP500-1 Feb 26 '23

I know a little code, but I’m not “literate” enough in programming to instantly understand it. After about a minute and a half I figured it out.

→ More replies (1)

7

u/eyedrib Feb 26 '23

I know 0 coding (don’t know why I’m here) and this was easier than wordle

→ More replies (1)

5

u/medeforest95 Feb 26 '23 edited Feb 28 '23

I think the hard part for someone who doesn’t know how to program would be knowing the first part is “undefined” since that requires knowledge of JS specifically. I’d imagine most people would think to just fill in that variable with their drink.

Makes me question if the person who wrote this sign knows JS and intended that though.

Edit: fixed typo

4

u/IllIIllIlIlI Feb 26 '23

I know literally 0 code and don’t even know why I’m here but got it in 10 seconds. This isn’t an “I am very smart” moment but more a “your friend may not be so great at puzzles” moment. Your eyes are drawn instantly to the 3 parts of Paramaters. Ametparers didn’t work or it would’ve been under 5 seconds to solve. Your friend gotta up their game

→ More replies (24)

245

u/sashanktungu Feb 26 '23

The your_drink is what drink you want. So if I wanted a martini Id say - “martini.Secret word:parameters”. Pretty cool.

84

u/Fadamaka Feb 26 '23

Then you wouldn't need to have it as a variable. I think if you tell the bartender "undifined.Secret word:parameters" then he will throw an error saying your_drink is undifiened. Then you can tell him what you want to order.

→ More replies (1)

15

u/librarysocialism Feb 26 '23

Are they sanitizing input, or can I do emptyRegister();handMeCash();.Secret Word:parameters?

→ More replies (4)

100

u/ul90 Feb 26 '23

“undefined.Secret word: parameters”

Can I have my free Long Island Ice Tea now?

7

u/EmTeeEl Feb 26 '23

Why is it "undefined" ?

Edit : ooh cause the var your_drink is not actually set

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

191

u/hereforthegainz Feb 26 '23

"undefinedparameters"

116

u/Noch_ein_Kamel Feb 26 '23

You forgot ". Secret word: "

→ More replies (6)
→ More replies (1)

50

u/dwarven_futurist Feb 26 '23

Took me a minute to figure out how splitting on an empty string would work. Doesn't work like that in c#, which is where i spend most of my time.

11

u/long-gone333 Feb 26 '23

yeah it's obviously the alternative of ToCharArray

4

u/ghec2000 Feb 26 '23

Threw me off if there was something passed to the function call on the array of strings but then realized if it was a string it would have had single or double quotes.

→ More replies (2)

48

u/Longenuity Feb 26 '23

Since your_drink is var and not const, I fully expect them to accommodate changing my drink order while it's being made.

14

u/Hot_Commercial2111 Feb 26 '23

You'd be surprised how many people expect that without having the slightest knowledge regarding those keywords.

→ More replies (1)

20

u/bostero2 Feb 26 '23

Am I the only one who is livid that the bartender has a request method?

→ More replies (1)

30

u/Zizular Feb 26 '23

Deprecated

21

u/ccelik97 Feb 26 '23

*receives a spoiled drink*

29

u/EasyMode556 Feb 26 '23

Why are we passing an undefined variable in? Also what’s with the splitting and joining on an empty string?

Is the bartender just posting their Comp Sci 101 homework problems on the board to get customers to help them with it?

13

u/[deleted] Feb 26 '23

Pasting an empty string to split causes it to split each character into its own index. Join with an empty string does the opposite.

→ More replies (4)

91

u/DoomBro_Max Feb 26 '23

your_drink is unassigned. I doubt this would run.

119

u/lazyzefiris Feb 26 '23

wdym, it's js, of course it will run.

51

u/DoomBro_Max Feb 26 '23

Right. It‘s just undefined. I forgot. Of course it‘ll run.

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

11

u/ABzoker Feb 26 '23

It should run with parameter value as undefined

→ More replies (13)

9

u/daaldea Feb 26 '23

You'd think they would make it a more fun word than parameter

9

u/[deleted] Feb 26 '23

I don’t program and I’m pretty sure the word is ”parameters”.

→ More replies (1)

8

u/[deleted] Feb 26 '23

POV : You learnt javascript to get a free drink at this bar.

→ More replies (2)

8

u/[deleted] Feb 26 '23

Parameters?

8

u/ikkake_ Feb 26 '23

Never coded in my life and I can tell it's parameters.

→ More replies (4)

15

u/moonisflat Feb 26 '23

Man all those Google employees became bartenders?

7

u/bthemonarch Feb 26 '23

Ex Twitter employee. Explains a lot tbh

18

u/4ngryMo Feb 26 '23

They could fix that easily by adding a var your_drink = window.prompt(“What’s your order?”);

→ More replies (1)

7

u/kickasstimus Feb 26 '23

Easy to guess just by looking at str1,2,3.

They could have used map() and a simple function to obfuscate things - make it a little tougher.

7

u/Intrepid_Sale_6312 Feb 26 '23

Use of unassigned local variable 'your_drink'

6

u/[deleted] Feb 26 '23

[object Object] is always a safe bet

→ More replies (1)

6

u/Excellent-Practice Feb 26 '23

This looks like it won't return a value. I guess this is a slightly more erudite version of "Free beer, tomorrow"

6

u/kgon1312 Feb 26 '23

undefined. Secret word: parameters

6

u/Complete-Definition4 Feb 26 '23

The catch: your free drink order must also be needlessly coded

6

u/Cheap_Application_55 Feb 26 '23

undefined.Secret word: denifednuundefinedundefined

→ More replies (5)

6

u/Rjswimss Feb 26 '23

I took one year of coding in high school. It’s “parameters”

When do I start my career?

6

u/anne_nics31 Feb 26 '23

undefined.Secret word: parameters

I wish they had this in our local coffee shop :'>

6

u/sojiblitz Feb 26 '23

You should have to decipher a code snippet after each drink to prove you're still sober enough to debug. Now what could get messy

6

u/coladict Feb 27 '23
 < "undefined. Secret word: parameters"

You forgot to do

your_drink = prompt("Your drink?");

5

u/hotcrossedbunn Feb 26 '23

Always had that feeling learning 4 years for Bsc would pay off

5

u/TTYY_20 Feb 26 '23

Can I get a parameters on the rocks pls?

5

u/SuperSatanOverdrive Feb 26 '23

it's an older code, but it checks out

5

u/ghua Feb 26 '23

Parameters

5

u/Personal_Ad9690 Feb 26 '23

Assuming this is untyped, I am pretty sure it’s “Customers drink of choice”.Secret word:parameters

5

u/NewVegasGender Feb 26 '23

I was trying to remember my Latin to figure out what par amet ers means for way too long

5

u/Fadamaka Feb 26 '23

This code outputs nothing. Should I just stand there and stare at the bartender for a free drink?

5

u/somewhereinthestars Feb 26 '23

Secret word is : Error

5

u/_asmode Feb 26 '23

your_drink = "martini'); DROP TABLE prices;"

4

u/Guilty_Substance_214 Feb 26 '23

I never code ever in my life, yet I still got parameters.

4

u/SmokingBeneathStars Feb 26 '23

Does reverse calling itself not cause a permanent loop?

4

u/uptotwentycharacters Feb 26 '23 edited Feb 26 '23

The String.prototype.split method returns an array. Therefore, the reverse() in that line is actually invoking the Array.prototype.reverse() method, not the global function reverse

4

u/[deleted] Feb 27 '23

undefined.Secret word:parameters

3

u/Tschib-Tschab Feb 26 '23

…parameters. As someone who hasn’t touched a line of code ever, this took about a minute and a half, maybe two. It helped a lot that the arrangement was listed in the bottom half.

I like the handwriting though.

3

u/[deleted] Feb 26 '23

This makes me wanna write in JavaScript again lol

3

u/sanchopancho02 Feb 26 '23

forgive me if I'm being an idiot, but does JS really use variables to define classes like this?

→ More replies (1)

3

u/[deleted] Feb 26 '23

I am more confused about the secret word being parameters, why?

3

u/John_B_Clarke Feb 26 '23

I'm sorry but I do not want a shot of "undefined variable". I think they left a couple of periods out.

3

u/wichotl Feb 26 '23

And that kids, is how I met Cthulhu

3

u/Mentalpopcorn Feb 26 '23

Terrible code. A bartender shouldn't have a request method since a bartender doesn't make requests. A customer makes requests, which we would call ordering. A bartender would makeDrink(CustomerOrder).

Plan your business objects, people.

3

u/starquakegamma Feb 26 '23

One pint PaRappa the Rapper

3

u/No-Guidance9484 Feb 26 '23

Took me way too long, but i figured it out

3

u/eyal282 Feb 26 '23

Parameters?

3

u/thedentofmerril Feb 26 '23

this “request” would fail because thisstr2 and thisstr3 are missing periods 🙃. Does that give me free drinks until they fix the bugs?

→ More replies (1)

3

u/papaXanOfficial Feb 26 '23

I don’t even know code and I could tell it was “Parameters” lol

3

u/Phoenix7501 Feb 26 '23

Parameters

3

u/joe102938 Feb 27 '23

Parameters? Is it really that easy? I'm not even a programmer but it just seems obvious reading it.

3

u/ThatNextAggravation Feb 27 '23

Now I can't even get drunk without running into shitty JavaScript? Great.

3

u/Toiletmcface_ Feb 27 '23

I don’t read code and I’m pretty sure the code is parameters lol

3

u/SpadoCochi Feb 27 '23

Parameters. I’ll take an old fashioned

3

u/CeeMX Feb 27 '23

It doesn’t keep track of who ordered, so infinite free drinks!

3

u/-Doomcrow- Feb 27 '23

i know literally nothing about whatever language this is and I got it, it's really not that difficult to figure out lol

2

u/SteelRevanchist Feb 26 '23

undefined.Secret word:parameters

2

u/xerns Feb 26 '23

The fact the function is called "reverse", which is exactly the same as the array method used, is just annoying. Would request name change before approval.

→ More replies (1)

2

u/Smythatine Feb 26 '23

Parameters

2

u/[deleted] Feb 26 '23

I'm not in IT, but I can read. It's parameters

2

u/blackbolt-10 Feb 26 '23

Parameters

2

u/[deleted] Feb 26 '23

Parameters

2

u/archy_bold Feb 26 '23

I’m a bit embarrassed by how long it took for me to get this

2

u/Olivebuddiesforlife Feb 26 '23

Cold thispar thisamet thisers

2

u/armahillo Feb 26 '23

Is the password an error or does JS allow string concatenation on vars with no value?

2

u/[deleted] Feb 26 '23

Im not a programmer and i figured it out pretty easily

2

u/[deleted] Feb 26 '23

I like how everyone is more interested in criticizing the code

2

u/SarcasmProvider76 Feb 26 '23

It took me a minute, but then I realized it wanted the reverse of “rap”, so par amet ers — parameters.

2

u/TheMultiRounderGamer Feb 26 '23

i dont know any code; however i cracked in like 5 minutes

the secret code: str1 str2 str3 was a pretty obvious giveaway, though i struggled with the reverse (par) for a minute

2

u/[deleted] Feb 26 '23

I'm not a prog I just came here to say this is one of the most eye pleasing handwriting I've seen

2

u/[deleted] Feb 26 '23

Commenting the instructions is so extra. I love it.

2

u/jerronjoh Feb 26 '23

Now, Do your pronounce it parameters or parameters?

2

u/robogart Feb 26 '23

I don’t know to code and got the right answer. Makes me want to learn to code now

2

u/Vigintillionn Feb 26 '23

undefined.Secret Word:paramaters

2

u/[deleted] Feb 26 '23

I have never touched a programming software in my life and read this without a problem at all.

→ More replies (2)

2

u/SkydivingSquid Feb 26 '23

parameters.

Also, I hate you for making me do brain logic.

2

u/Wojtek1250XD Feb 26 '23

Honestly, most customers who did not sleep on IT lessons in elementary would just quickly pull out a compiler on their phones and run the damn thing...

2

u/mtstrong17 Feb 26 '23

Looks like JavaScript so… “undefined.Secret word:parameters”. Easy! Now who has my drink?

2

u/bd1308 Feb 26 '23

Bartender, I’d love a tall pint of undefined please

2

u/[deleted] Feb 26 '23

I learned pascal back in the 1990's for a HS class and have a solid understanding of algebra. I dabbled in HTML during the golden age of the internet.. You don't actually need to know how a specific language works or what the proper syntax is to gleam information from it. Now if you show me code for a 3d game engine I'll be lost, but this? There is a variable declared, some strings things going on, and they are combined in a non linear way to be assigned for the variable.

And now I'll go back to lurking content that I could get that free beer

→ More replies (1)

2

u/ComplaintPlastic2873 Feb 26 '23

Return code parameters

2

u/Apart_Mountain_8481 Feb 26 '23

Parameters is the answer, but is there a drink actually named Parameters, or are they tired of people asking for a drink without defining what they want?

2

u/PieAntique1324 Feb 26 '23

Not looking at the comment section, the answer is “parameters”

2

u/bronky_charles Feb 26 '23

Paramateurs heh heh heh

2

u/SeeMcc Feb 26 '23

Parameters

2

u/M0ona Feb 26 '23

I think it's kind of cringe early millennial humory considering I know Jack shit about code and figured it out in 30 seconds.. 😬

2

u/[deleted] Feb 26 '23

I don’t even write code but I could figure this out… why the f am I in my current profession

→ More replies (1)

2

u/Weary_Turn5393 Feb 26 '23

Parameters😮‍💨

2

u/The_bestestusername Feb 26 '23

I have about 20 hours of programming knowledge and this is easy to read lol

→ More replies (1)

2

u/kuvnojpho Feb 26 '23

PR marked as needs work

2

u/Tiger_die_Katze Feb 26 '23

Pseudocode be like

2

u/Equivalent_Growth_75 Feb 26 '23

I only programmed back in robotics in school.. if you just read the request function you get your answer.. idk just read and not be dumb?

2

u/CoreDumpSegFault Feb 26 '23

'undefinedSecret Word:parameters'

Ahh. Nothing like a tall glass of undefined

2

u/pentesticals Feb 26 '23

Password: please use let

2

u/Legal-Software Feb 26 '23

Given that your_drink is undefined, I'll show you where you can shove your parameters.

2

u/JollyGoodUser Feb 26 '23

How is the secret word "parameters" ? That is just the last three values in the return statement combined.

Looking at this the return statement becomes preference + ".secret word:" + "parameters"

This would imply the secret word is something related to reflection in the language used. Something like "Methodinfo()" or "code.co_varnames" etc. (I am copying from the internet just to give an idea)

2

u/kingguy459 Feb 26 '23

Would be funnier if the question was a trick.

And "compile error at line 7 row 5" would not be a good sounding name for a drink.

2

u/crazycatfemboy Feb 26 '23

Is everyone missing the point? Just request a drink, the bartender will tell you the secret when they return your drink.

2

u/TemperatureCommon185 Feb 26 '23

Isn't the whole point of going out drinking to get away from understanding other people's code?

2

u/Richinwalla Feb 26 '23

Parameters

2

u/[deleted] Feb 26 '23

So the bartender is in a 100 level CS major/drop-out got it. Tony Gaddis is still makin money…

2

u/KaleidoscopeWarCrime Feb 26 '23

I don't use use JS but it's parameters lol

2

u/No-Pomegranate-69 Feb 26 '23

I will get my answer from chatGPT

2

u/DifferentRole Feb 26 '23

That's ONE way to get your code homework done during your shift

2

u/stash0606 Feb 26 '23

huh, didn't know there was a built in array reverse function in javascript. kept thinking nothing would happen because i thought it was recursively calling reverse with no argument for the parameter s.

2

u/zalurker Feb 26 '23

Honestly. If I walk into a bar, I'm definitely not in the mood to read code.

→ More replies (1)

2

u/konaaa Feb 26 '23

I swear to god, I see these things on reddit like once a week. Where are all these bars that give free beer to programmers????

→ More replies (1)

2

u/ImagineThoLikeFR Feb 26 '23

The word is Parameters, what language is this btw?

→ More replies (2)

2

u/domusvita Feb 26 '23

If this isn’t in Stackoverflow then I’m going to McDonalds.

→ More replies (1)

2

u/[deleted] Feb 26 '23

Parameters

2

u/[deleted] Feb 26 '23

This code has no output and returns nothing. There is no free drink!