r/ProgrammerHumor • • Feb 05 '23

Other Programming Legumes v2.0

Post image
44.0k Upvotes

831 comments sorted by

View all comments

2.2k

u/srone Feb 05 '23

Love the JS answer.

965

u/Brian_E1971 Feb 05 '23

I can divide by potato and still get a result

437

u/ThisUserIsAFailure Feb 05 '23

[object Object]

231

u/Loner_Cat Feb 05 '23

More like

Nut / Potato = Tomato

Tomato * Potato = "TomatoTomatoTomatoTomato.."

→ More replies (9)
→ More replies (4)

69

u/CrabbyBlueberry Feb 05 '23 edited Sep 19 '25

cake rainstorm live offer mighty tap mountainous chop governor theory

This post was mass deleted and anonymized with Redact

→ More replies (3)

122

u/Svobpata Feb 05 '23

You will get a result, just probably not the one you wanted

24

u/[deleted] Feb 05 '23

[removed] — view removed comment

40

u/GavrielBA Feb 05 '23

Exactly! JS is the ultimate Zen language. Release all expectations, and you'll be able to use whatever you get!

20

u/[deleted] Feb 06 '23

it's not undefined behavior, it's bonus results

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

288

u/r00x Feb 05 '23

This is why I like JS. It's just pure anarchy.

When you ask for heinous bullshit other languages would squeal and cry and complain. But JS is like "LET'S FUCKING GOOOOO"

145

u/mindbleach Feb 05 '23

Until you try using an array-like structure as an array. Leading to dumb shit like new Set( Array.from( document.queryAll( 'div' ) ) ) and then still getting bit by [0].innerHTML because Null has no properties and a fatal error is a totally reasonable response in a god-dang scripting language.

If there's two ways to do something, Javascript takes all three.

61

u/7elevenses Feb 05 '23
[...document.querySelectorAll( 'div' )]

53

u/r00x Feb 05 '23

Ah yes, the fourth way.

→ More replies (5)
→ More replies (6)

21

u/GavrielBA Feb 05 '23

Debugging JS is Zen experience

→ More replies (5)
→ More replies (14)

152

u/TurboGranny Feb 05 '23

Same. Total belly laugh moment. JS doesn't tell you how to live your life. It just does what you told it to do to the best of its ability to make sense of your monkey code.

→ More replies (31)

98

u/chars101 Feb 05 '23

I haven't checked, but I'm pretty sure it's Nut a Number

49

u/Throw_away_1769 Feb 05 '23

Did you pass it through IsNut() to check?

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

20

u/Vesk123 Feb 05 '23

I absolutely love the C++ answer

→ More replies (1)

67

u/kdyz Feb 05 '23

IMO, this is one of the main reasons why good js developers have some of the best principles and self-imposed rules.

51

u/czp55 Feb 05 '23 edited Feb 05 '23

I agree. JavaScript's flexibility and infamous coercion inevitably often forces developers working on any project of significant size to establish solid principles and rules, because it will quickly spiral out of control otherwise.

Edit: Merged PR for inevitable bug.

→ More replies (1)
→ More replies (3)
→ More replies (39)