12

what is the else there for, it reminds me of all the times I saw shit like

if(variable == true){
}else{
doSomething();
}

Comments
  • 4
    I did this once when I was like 14. I felt dirty. But I had no idea how to cleanly reverse a rather complicated bit of logic.

    Now I'd just rewrite it, or, I dunno, do this:

    if (!(complicated conditional))

    lol
  • 0
    @Ashkin We all had that, but pseudocode, please 😕
  • 4
    @JoshBent

    complicated_condition = (first_flag or !second_flag and !((second_flag xor third_flag) or fourth_flag))

    if (!complicated_condition) { ... }

    Instead of
    ...
    You know what, I'm not inverting that. Too much typing on my phone. Even with a builder approach.
  • 1
    @Ashkin I was refering to the image I posted in the rant, not that you didnt post a full code example 😉
  • 2
    @JoshBent sorries!
    I'm a wee bit drunk
  • 0
    Explicit is better than implicit. Especially in pseudo code.
  • 2
    @JoshBent umm sir? That is my code, in devrant issue tracker. I am sure i wrote notshow.EditButton(), but i guess i was sleepy. Sorry about that
  • 1
Add Comment