M
Mayeul
Lew said:And for-each loops are little more than glorified for() loops with the
additional hassle that you might forget that you needed an index.
Generics are little more than glorified Objects with the additional
hassle that you need to actually understand the type model of your
code. Assertions are little more than glorified if statements with
the additional hassle that you might forget and leave them on in
production. Methods are little more than glorified goto statements
with the additional hassle that you have to match up by type all the
arguments. If statements are little more than glorified gotos with
the additional hassle that you have to remember your braces or
mismatch your 'else' clauses. Object-oriented programming is little
more than glorified assembly-language programming with the additional
hassle that you have to understand the model for your application.
Really, one example was far enough. I get it, a language feature or
construct is to be used where it actually helps.
I so happen to really not think much of switch in most situations where
OOP is available. And I also happen to think it encourages to forget
'break' statements (or miss the presence or absence of break statements
when reading the code) if it is not supposed to return. A more serious
inconvenience than what you pointed out in your examples. That is what I
think. Hence 'If you ask me.'
As much as my seemingly-condescending* tone might make you think it was,
it wasn't my point. My point was that in the given example, replacing if
ladders with switch would buy little in terms of bloat, and that taking
advantage of enums is more likely to.
* I don't really sound like that on purpose. I learn English on teH
InTerNets and that sort of expressions are overused and tend to be
memorized for later reuse more easily.