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
		
- 
				
				 Grumpy28679yAny 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. Grumpy28679yAny 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.
- 
				
				 Arlekin8909y@Grumpy oh well, you are right... i must be really tired, time to go to sleep... on the other hand though... devRant! Arlekin8909y@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).
- 
				
				 Grumpy28679y@Jase Note the words "thinks he does" in my comment. Grumpy28679y@Jase Note the words "thinks he does" in my comment.
 
 (This is the second time I have to write this).
- 
				
				 Grumpy28679y@Demiourgos Ouch, the pain! No, no and no again; you should NOT write Grumpy28679y@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.
- 
				
				 johnDoe32019yWhen I was first starting out programming I made the mistake of doing while(variable = true) johnDoe32019yWhen 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
- 
				
				 Grumpy28679y@NickB Actually, it doesn't, because it like writing Grumpy28679y@NickB Actually, it doesn't, because it like writing
 if (((murderingRobots == true) == true) == true)
 
 if (murderingRobots)
 is the sane way.
Related Rants











 Plot twist
Plot twist
Why code review is important.
undefined
code review
robots
death