problems/risks due to programming language

Scott MacHaffie machaffi at fred.cs.washington.edu
Fri Feb 23 17:51:09 AEST 1990


In article <8133 at hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu writes:
>   common practice to use break statements by the dozen in order to get 
>   it to behave reasonably.  A more sensible design would give the switch 
>   the semantics of the Ada case statement, thereby saving countless lines 
>   of code through the elimination of all those "break" statements. 

But it would also ADD countless lines of code:

ANSI C:
switch (x) {
	case '0': case '1': ... case '9':
		digit(x);
		break;
}

ADA-C:
switch (x) {
	case '0': digit(x);
	case '1': digit(x);
	...
	case '9': digit(x);
}
		Scott MacHaffie



More information about the Comp.lang.c mailing list