Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Grumpy28828yAny programmer who compares (or thinks he does, as in this case) a boolean expression with 'true' deserves to get his ass kicked by a robot.
-
Arlekin8948y@Grumpy oh well, you are right... i must be really tired, time to go to sleep... on the other hand though... devRant!
-
@NickB well, instead of writing if(murderingRobots = true) you would need if(murderingRobots == true).
-
Grumpy28828y@Jase Note the words "thinks he does" in my comment.
(This is the second time I have to write this). -
Grumpy28828y@Demiourgos Ouch, the pain! No, no and no again; you should NOT write
if(murderingRobots == true)
because that's just as dumb as writing
if((murderingRobots == true) == true)
or
if(((murderingRobots == true) == true) == true)
etc etc.
if(murderingRobots)
is the correct way. -
johnDoe32138yWhen I was first starting out programming I made the mistake of doing while(variable = true)
Took me awhile to figure out why I was getting an infinite loop.
Never again did i evaluate booleans this way -
Grumpy28828y@NickB Actually, it doesn't, because it like writing
if (((murderingRobots == true) == true) == true)
if (murderingRobots)
is the sane way.
Related Rants
Why code review is important.
undefined
code review
robots
death