150

Why code review is important.

Comments
  • 3
    story of our life
  • 20
    Any 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.
  • 0
    @Grumpy where do you see comparison here??
  • 3
    @Arlekin Note the words "thinks he does" in my comment.
  • 2
    @Grumpy oh well, you are right... i must be really tired, time to go to sleep... on the other hand though... devRant!
  • 3
    @NickB Just the variable name would suffice, it will be then evaluated.
  • 1
    @NickB well, instead of writing if(murderingRobots = true) you would need if(murderingRobots == true).
  • 2
    Or like he said
    if (murderingRobots) { }
  • 1
    This is why unit tests are important. :)
  • 0
    @Jase Note the words "thinks he does" in my comment.

    (This is the second time I have to write this).
  • 5
    @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.
  • 1
    When 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
  • 0
    Testing in production
  • 0
    @NickB Actually, it doesn't, because it like writing
    if (((murderingRobots == true) == true) == true)

    if (murderingRobots)
    is the sane way.
Add Comment