Programming Jokes

  • #71
jack action
Science Advisor
Insights Author
Gold Member
2,639
5,491
Not really a joke but still funny:

Did you know that ++[[]][+[]]+[+[]] evaluates to the string "10" in Javascript?
 
  • Like
  • Wow
Likes DrClaude, Wrichik Basu and Ibix
  • #72
Wrichik Basu
Insights Author
Gold Member
2022 Award
2,022
2,159
1670273563693.png
 
  • Like
Likes 256bits, Ibix, BillTre and 1 other person
  • #73
Wrichik Basu
Insights Author
Gold Member
2022 Award
2,022
2,159
1670273764304.png
 
  • Like
Likes berkeman, Ibix and phinds
  • #74
Ibix
Science Advisor
Insights Author
2022 Award
10,074
10,634
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...?
 
  • #75
jack action
Science Advisor
Insights Author
Gold Member
2,639
5,491
A developer's night is never complete without at least one "aha!" moment, and at least one "oh no!" moment.
 
  • Like
Likes Wrichik Basu
  • #78
Ibix
Science Advisor
Insights Author
2022 Award
10,074
10,634
I recall someone asking for confirmation that one is true and zero is false in C, to which some genius replied "1".
 
  • Like
  • Haha
Likes phinds, collinsmark, DrClaude and 5 others
  • #79
berkeman
Mentor
64,131
15,340
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... :wink:
 
  • #84
Borg
Science Advisor
Gold Member
2,065
3,432
Speaking of memory.

Memories.jpg
 
  • Like
  • Haha
Likes Ibix, 256bits, jack action and 4 others
  • #103
Borg
Science Advisor
Gold Member
2,065
3,432
I was having trouble with my internet at the farm, so I moved the modem to the barn.

Now I have stable wifi.
 
  • Like
  • Haha
Likes Wrichik Basu, Ibix, jack action and 1 other person
  • #105
Tom.G
Science Advisor
Gold Member
4,690
3,442

I was having trouble with my internet at the farm, so I moved the modem to the barn.

Now I have stable wifi.


It may be stable but, I bet its thruput stinks.
 
  • Like
Likes BillTre and Ibix

Suggested for: Programming Jokes

  • Last Post
6
Replies
191
Views
12K
Replies
13
Views
975
Replies
1
Views
309
  • Last Post
Replies
1
Views
120
Replies
16
Views
776
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
10
Views
2K
Replies
1
Views
409
Top