Hacker News new | ask | show | jobs
by ggambetta 1112 days ago
This to me screams "I don't understand boolean variables".

Why stop there?

  switch (byte_value) {
    case 0: return 0;
    case 1: return 1;
    ...
    case 255: return 255;
  }
2 comments

Visualizing control flow from if ladder effort: minimal

Doing the same for not tiny boolean expression: way more

Just because you think it is cool cuz profs forced it on ya during college is not a argument

Ironically, I have had profs tell me to use nested ifs instead of breaking loops, so…
It's personal taste. You can subdivide boolean expressions just as easily with if-then-elses as with boolean functions.

What most people object to is leaving the last level of if-then-else and returning true or false, when you could have returned simpleBooleanExpression and do away with 1 level of nesting.