CS 342 Lecture -*- Outline -*- * Benefits of Orthogonal design ** Avoiding undesirable feature interaction features may affect each other in unanticipated ways *** e.g., switch and if-expressions in Algol 60 also: switches are allowed as parameters! *** avoid by orthogonal design each feature should only do one thing, and not interact with other features that act similarly e.g., switch allows choice of various labels, if allows choice, so no need to allow if within switch ** Localizing costs *** e.g., for loop reevaluates expressions each time (also acts as a while loop) so no cheap definite iteration (without analysis of program) *** solution, make each usage a separate feature definite vs. indefinite iteration in separate statements