|Index||Musings on computing|
"For many people trained in languages such as C, Pascal, Modula-2, Ada, etc., there is an almost irresistible urge to organize software as a set of switch statements. This urge should most often be resisted. Please note that even though the standards committee approved a RTTI [run-time type information] for C++, we did not support it with a type-switch statement (such as Simula's INSPECT statement). I still don't consider a type switch a model of software organization worth supporting directly. The examples where it is appropriate are far fewer than most programmers believe at first - and by the time a programmer has second thoughts, the reorganization needed will most likely involve too much work to be done"
Bjarne Stroustrup, "The Design and Evolution of C++", p. 314
Copyright © Paul John Floyd 2002.