3 ms·
Aren't switch-case statements widely accepted in C++ No. Some people say they're a sign of a poorly architected object model.
by ktRolster 10y ago
Aren't switch-case statements widely accepted in C++
No. Some people say they're a sign of a poorly architected object model.
- ycombobreaker 10y agoBoth of those statements can be true, though. Switch-case statements are widely accepted in industry, yet some developers disagree with their use. In my opinion, it's hard to beat a jump table for some operations, which a switch block neatly performs. And there's a rational continuum between boolean conditionals, multi-state (>2) conditionals, and polymophism, such that i think "some people"'s assertion sounds like throwing out the baby with the bathwater.