Which is better?

ix269 at sdcc6.UUCP ix269 at sdcc6.UUCP
Wed Dec 19 20:04:42 AEST 1984


both forms are of the same speed as best as I can determine,
but the latter form is much more readable at a glance (Note
that this is a style judgement, and purely my own opinion).

	switch (whosit) {
	    case 0:
		if (A) {
		    dothis();
		    break;
		}
		elsethis();
		break;
	    case 1:
		if (B) {
		    dothis();
		} else {
		    elsethis();
		}
		break;
	}



More information about the Comp.lang.c mailing list