Programming Jokes

Gold Member
Not really a joke but still funny:

Did you know that ++[[]][+[]]+[+[]] evaluates to the string "10" in Javascript?

DrClaude, Wrichik Basu and Ibix
Gold Member
2022 Award

256bits, Ibix, BillTre and 1 other person
Gold Member
2022 Award

berkeman, Ibix and phinds
2022 Award
Not really a joke but still funny
And/or horrifying. Yet strangely fascinating. I feel a bit like this is a prototype of the Enki virus from Snowcrash (Edit: Or was Inanna the virus and Enki the cure? Can't remember.)
Did you know that ++[[]][+[]]+[+[]] evaluates to the string "10" in Javascript?
So, trying to work this out: +[] is a trick where an empty list is coerced into a zero, right? So it's ++[[]][0]+[0]. And the zeroth element of the first list is an empty list, so it's ++[]+[0]. Then the increment operator coerces the empty list to a zero and adds one to it, giving 1+[0] which then turns into a "10" via string concatenation for some reason...?

Gold Member
A developer's night is never complete without at least one "aha!" moment, and at least one "oh no!" moment.

Wrichik Basu
Gold Member
2022 Award

phinds, jack action, dlgoff and 1 other person
Gold Member
2022 Award
2022 Award
I recall someone asking for confirmation that one is true and zero is false in C, to which some genius replied "1".

phinds, collinsmark, DrClaude and 5 others
Mentor
I recall someone asking for confirmation that one is true and zero is false in C, to which some genius replied "1".
++0 would have been funnier...

phinds
Gold Member
2022 Award

Not anonymous, Ibix, BillTre and 2 others
Gold Member
2022 Award

Ibix, 256bits, BillTre and 1 other person
Gold Member
2022 Award

Ibix, collinsmark and BillTre
Gold Member
2022 Award

Not anonymous
Gold Member
Speaking of memory.

Ibix, 256bits, jack action and 4 others
Gold Member
2022 Award

DaveC426913
Gold Member
2022 Award

Ibix and DaveC426913
Gold Member
2022 Award

Ibix, Borg, BillTre and 1 other person
Gold Member
2022 Award
Gold Member

Wrichik Basu
Gold Member
2022 Award

Ibix and berkeman
Gold Member
2022 Award
Gold Member
2022 Award

BillTre and phinds
Gold Member
2022 Award

collinsmark, pbuk, Bandersnatch and 4 others
Gold Member
2022 Award

jack action, Ibix and Borg
Gold Member
2022 Award

DrClaude and Ibix
Gold Member
2022 Award

Ibix
Mentor
Was that at the Foo bar?

Ibix and Wrichik Basu
Gold Member
2022 Award

pbuk, Ibix, BillTre and 2 others
Gold Member
2022 Award

Ibix and jack action
Gold Member
It's funny because it's true.

Gold Member

Ibix
Gold Member

Wrichik Basu and WernerQH
Gold Member
I was having trouble with my internet at the farm, so I moved the modem to the barn.

Now I have stable wifi.

Wrichik Basu, Ibix, jack action and 1 other person
Mentor
Now I have stable wifi.
Oh my gawd...