25

You know what drives me crazy.. seen this inside code of "senior devs"
If(something() == true){
// do something
}

Dude!!! The if only happens if its true!
Code this..
If(something()){
// do something
}
OHHH but if i say something I GET IN TROUBLE.

Comments
  • 0
    Seen that on juniors quite often. You know the explanation? „It‘s a bool? and we use it as tri-state“ me: *SLAP*
  • 2
    I do that aswell, it helps me debug my code while talking to myself
    "So if this is true this happens.."

    But try to write 'true==something()'
    Less error-prone incase you forget a =
  • 0
    I know. It. Is. So. DISGUSTING.
  • 0
    Well this is disturbing.
    In python even in if else I compare None value using if a is None even when I know that I can do it without comparing it to None but..
Add Comment