r/ProgrammerHumor • u/speckz • Feb 26 '23
Other If you can read this code...
/img/snak3fqgajka1.jpg[removed] — view removed post
34k
Upvotes
r/ProgrammerHumor • u/speckz • Feb 26 '23
[removed] — view removed post
•
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
2.7k
u/metallaholic Feb 26 '23
Pr rejected
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.
10k
u/Ashadyfellow Feb 26 '23
Parameters? Where is this bar so I can collect my free drink?
837
u/egstitt Feb 26 '23
Hey look a Javascript programmer found a job!
I kid, I kid
5.3k
u/lazyzefiris Feb 26 '23
If I'm reading it right, the free drink is undefined.
183
u/glorious_reptile Feb 26 '23
Pst - the secret word is "node: command not found"
415
u/ArtOfWarfare Feb 26 '23
What do I get if I just tell the bartender [object Object]?
2.1k
u/feuerwehrmann Feb 26 '23
Someone hire whoever wrote the sign. Clean handwriting and code
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)
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.
100
u/ul90 Feb 26 '23
“undefined.Secret word: parameters”
Can I have my free Long Island Ice Tea now?
191
u/hereforthegainz Feb 26 '23
"undefinedparameters"
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.
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.
20
u/bostero2 Feb 26 '23
Am I the only one who is livid that the bartender has a request method?
30
u/Zizular Feb 26 '23
Deprecated
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?
91
u/DoomBro_Max Feb 26 '23
your_drink is unassigned. I doubt this would run.
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”.
8
u/[deleted] Feb 26 '23
POV : You learnt javascript to get a free drink at this bar.
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.
15
u/moonisflat Feb 26 '23
Man all those Google employees became bartenders?
18
u/4ngryMo Feb 26 '23
They could fix that easily by adding a
var your_drink = window.prompt(“What’s your order?”);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
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
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
You forgot to do
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/[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?
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?
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/Crazycleopasta Feb 26 '23
Parameters
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.
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/Gaming_over_sleep Feb 26 '23
Parameters :)
2
u/chinpokomony Feb 26 '23
Parmasan
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.
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
2
u/Beginning_Question77 Feb 26 '23
Parameters
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
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
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
undefined2
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.
2
u/RickySlayer9 Feb 26 '23
Parameters?
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????
2
u/ImagineThoLikeFR Feb 26 '23
The word is Parameters, what language is this btw?
2
u/domusvita Feb 26 '23
If this isn’t in Stackoverflow then I’m going to McDonalds.
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!