WallOfShame
From CS 152
Contents |
Programming Language Design Wall of Shame
awk
- Local variables of functions are defined as "additional parameters" to the function. You call the function with as many parameters as you like; the rest are unbound and can be used for locals. The manual says "By convention, you should write an extra space between the arguments and the locals, so other people can follow how your function is supposed to be used." Brian mentioned this in class as one of awk's worst features.
Tcl
- The upvar command allows a procedure to modify the local variables of any procedure on the call stack; the stack frame is specified numerically relative to the current frame. Using a number greater than 1 is considered "fragile" and "poor programming practice".
- The uplevel command allows arbitrary code to be executed in the context of any (relatively specified) stack frame. Only "power users" should use upvar inside of uplevel.
COBOL
- The ALTER statement changes the target of a GOTO. Even better, if the code is reloaded via an overlay, the original branch target is restored.
