MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/wdlvla/printhello_world/iij4rhv
r/ProgrammerHumor • u/a-slice-of-toast • Aug 01 '22
5.7k comments sorted by
View all comments
1.8k
0 == "0"
3.9k u/a-slice-of-toast Aug 01 '22 0__0 443 u/WraithWinterly Aug 01 '22 True 32 u/[deleted] Aug 01 '22 [removed] — view removed comment 11 u/jackdopeaf Aug 01 '22 Or PHP 7 u/[deleted] Aug 01 '22 Or php 4 u/Squrt- Aug 02 '22 Or php → More replies (2) 4 u/No-Standard-8784 Aug 02 '22 || PHP 6 u/jackdopeaf Aug 01 '22 Or PHP 6 u/[deleted] Aug 01 '22 Or php 3 u/Squrt- Aug 02 '22 Or php → More replies (1) → More replies (2) → More replies (10) 5 u/JAiFauxThe Aug 01 '22 8==D Gottem (for some values of D)! → More replies (3) 86 u/Draconian-Overlord Aug 01 '22 Zero is a string measurement of your mom's thong. 3 u/[deleted] Aug 01 '22 Don’t know what this means, but it got me laughing. → More replies (3) 17 u/cucumberks Aug 01 '22 True 11 u/no-one-here123 Aug 01 '22 see? Javascript does make sense! 8 u/TGPapyrus Aug 01 '22 False → More replies (2) 19 u/itzNukeey Aug 01 '22 knowing javascript it will return '1' 7 u/redcowerranger Aug 01 '22 But 0 === “0” would return ‘0’ iirc → More replies (2) → More replies (1) 4 u/Deon2137 Aug 01 '22 the correct anwser is javascript hell 4 u/Vycid Aug 01 '22 edited Aug 01 '22 > 0 == "0"FalseAlso acceptable is a compiler error due to type mismatch.Godbolt GCC says> printf(0 == "0" ? "True" : "False");FalseThere's simple, then there's wrong. 2 u/the_clash_is_back Aug 01 '22 0 is a variable which is true if it is the character 0. 2 u/ChuckFina74 Aug 02 '22 You’re sick → More replies (9)
3.9k
0__0
443 u/WraithWinterly Aug 01 '22 True 32 u/[deleted] Aug 01 '22 [removed] — view removed comment 11 u/jackdopeaf Aug 01 '22 Or PHP 7 u/[deleted] Aug 01 '22 Or php 4 u/Squrt- Aug 02 '22 Or php → More replies (2) 4 u/No-Standard-8784 Aug 02 '22 || PHP 6 u/jackdopeaf Aug 01 '22 Or PHP 6 u/[deleted] Aug 01 '22 Or php 3 u/Squrt- Aug 02 '22 Or php → More replies (1) → More replies (2) → More replies (10) 5 u/JAiFauxThe Aug 01 '22 8==D Gottem (for some values of D)! → More replies (3)
443
True
32 u/[deleted] Aug 01 '22 [removed] — view removed comment 11 u/jackdopeaf Aug 01 '22 Or PHP 7 u/[deleted] Aug 01 '22 Or php 4 u/Squrt- Aug 02 '22 Or php → More replies (2) 4 u/No-Standard-8784 Aug 02 '22 || PHP 6 u/jackdopeaf Aug 01 '22 Or PHP 6 u/[deleted] Aug 01 '22 Or php 3 u/Squrt- Aug 02 '22 Or php → More replies (1) → More replies (2) → More replies (10)
32
[removed] — view removed comment
11 u/jackdopeaf Aug 01 '22 Or PHP 7 u/[deleted] Aug 01 '22 Or php 4 u/Squrt- Aug 02 '22 Or php → More replies (2) 4 u/No-Standard-8784 Aug 02 '22 || PHP 6 u/jackdopeaf Aug 01 '22 Or PHP 6 u/[deleted] Aug 01 '22 Or php 3 u/Squrt- Aug 02 '22 Or php → More replies (1) → More replies (2)
11
Or PHP
7 u/[deleted] Aug 01 '22 Or php 4 u/Squrt- Aug 02 '22 Or php → More replies (2) 4 u/No-Standard-8784 Aug 02 '22 || PHP
7
Or php
4 u/Squrt- Aug 02 '22 Or php → More replies (2)
4
→ More replies (2)
|| PHP
6
6 u/[deleted] Aug 01 '22 Or php 3 u/Squrt- Aug 02 '22 Or php → More replies (1)
3 u/Squrt- Aug 02 '22 Or php → More replies (1)
3
→ More replies (1)
5
8==D Gottem (for some values of D)!
86
Zero is a string measurement of your mom's thong.
3 u/[deleted] Aug 01 '22 Don’t know what this means, but it got me laughing. → More replies (3)
Don’t know what this means, but it got me laughing.
17
11 u/no-one-here123 Aug 01 '22 see? Javascript does make sense! 8 u/TGPapyrus Aug 01 '22 False → More replies (2)
see? Javascript does make sense!
8 u/TGPapyrus Aug 01 '22 False → More replies (2)
8
False
19
knowing javascript it will return '1'
7 u/redcowerranger Aug 01 '22 But 0 === “0” would return ‘0’ iirc → More replies (2) → More replies (1)
But 0 === “0” would return ‘0’ iirc
the correct anwser is javascript hell
> 0 == "0"
Also acceptable is a compiler error due to type mismatch.
Godbolt GCC says
> printf(0 == "0" ? "True" : "False");
There's simple, then there's wrong.
2
0 is a variable which is true if it is the character 0.
You’re sick
1.8k
u/[deleted] Aug 01 '22
0 == "0"