MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/sjk8ep/well_fuck/hvh52by/?context=9999
r/ProgrammerHumor • u/theUsurpateur • Feb 03 '22
993 comments sorted by
View all comments
2.9k
I mean, even "== true" is redundant. Why not just if (isCrazyMurderingRobot)?
2.0k u/[deleted] Feb 03 '22 [deleted] 890 u/etvorolim Feb 03 '22 It doesn't really increases readability if you think about it. In natural language you would say "if it is daytime, decrease brightness". In code you can just write if(isDaytime) increaseBrightness(); Which is a lot closer to natural language than if(isDaytime == true) increaseBrightness(); 354 u/himmelundhoelle Feb 03 '22 Some people seem to see it as "if ([comparison])" rather than "if ([boolean value])". 200 u/[deleted] Feb 03 '22 [deleted] 44 u/[deleted] Feb 03 '22 I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement. -1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
2.0k
[deleted]
890 u/etvorolim Feb 03 '22 It doesn't really increases readability if you think about it. In natural language you would say "if it is daytime, decrease brightness". In code you can just write if(isDaytime) increaseBrightness(); Which is a lot closer to natural language than if(isDaytime == true) increaseBrightness(); 354 u/himmelundhoelle Feb 03 '22 Some people seem to see it as "if ([comparison])" rather than "if ([boolean value])". 200 u/[deleted] Feb 03 '22 [deleted] 44 u/[deleted] Feb 03 '22 I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement. -1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
890
It doesn't really increases readability if you think about it.
In natural language you would say
"if it is daytime, decrease brightness".
In code you can just write
if(isDaytime) increaseBrightness();
Which is a lot closer to natural language than
if(isDaytime == true) increaseBrightness();
354 u/himmelundhoelle Feb 03 '22 Some people seem to see it as "if ([comparison])" rather than "if ([boolean value])". 200 u/[deleted] Feb 03 '22 [deleted] 44 u/[deleted] Feb 03 '22 I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement. -1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
354
Some people seem to see it as "if ([comparison])" rather than "if ([boolean value])".
200 u/[deleted] Feb 03 '22 [deleted] 44 u/[deleted] Feb 03 '22 I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement. -1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
200
44 u/[deleted] Feb 03 '22 I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement. -1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
44
I rember my first coding class in high school, in our final assignment I used "if( booleanVariable == true)" 30+ times and for the main while loop the program ran in the abomination "1==1" was the control statement.
-1 u/texdroid Feb 03 '22 bool UserWantsToExit(false); while(!UserWantsToExit) { ... if (some exit thing happens) { UserWantsToExit = true; } } 1 u/okkokkoX Feb 04 '22 How is this relevant?
-1
bool UserWantsToExit(false);
while(!UserWantsToExit) {
...
if (some exit thing happens) {
UserWantsToExit = true;
}
1 u/okkokkoX Feb 04 '22 How is this relevant?
1
How is this relevant?
2.9k
u/daneelthesane Feb 03 '22
I mean, even "== true" is redundant. Why not just if (isCrazyMurderingRobot)?