News for hackers. Stuff that matters.
Re:Anti-if: The Missing Patterns by userbinator on Friday June 10, 2016 @07:10AM (#11875534)
switch-case is often compiled to a table lookup, but if your expressions are constant (at least for the part where the table is being used), the latter is definitely less verbose.

So it is clearer if it right there in the executable code rather than hidden away in some moving part (the mapping data structure).

Following several levels of nested if/else is "clearer" than going to the right array index? I don't know what you mean by "hidden away in some moving part".

Re:Anti-if: The Missing Patterns by adrianratnapala on Friday June 10, 2016 @04:20PM (#11879682)
If you have several levels of nested if-else (as opposed to a linear chain of "if"-"else if"), then you probably need a more complicated table than a linear array.

The moving appart that gets hidden away is the table (or more often, Hack mandictionary) that is stored somewhere in memory. If you are lucky, it is stored statically. It is never defined in quite the same place as the decision that it implements.