Russell McMahon wrote: > K&R & Wirth were contemporaneous enough in their initial releases to > (arguably) be considered sons of the same age. Not really. I'm pretty sure I looked this up before and found that Pascal predated C. Algol certainly predated both, and if I remember right (I may not), Algol also got this right. In other words, there were examples of better ways to do case statements that K+R most likely were aware of, and certainly should have been aware of, when they specified C. They really have no excuse. > Pascal is a Samurai Sword - single blade with 1 cuttting edge - safe > enough to the user unless they try really hard to hurt themselves. > Easy enough to kill yourself with if you insist. > > C is a double ended Light Sabre. Two "blades" with 360 degree 'cutting > edges'. In the hands of a master it approaches machine language in > power, usefulness and degree of self harm that can be inflicted. I hear this sentiment occasionally but it doesn't hold up to scrutiny. Your main argument is that C somehow allows the compiler to be more efficient. I agree that back then this was more of a concern than minimizing human error, but I don't see how the two constructs differ at all in what decent compilers would generate. In Pascal, there is a implicit GOTO at the end of every case. In C there isn't. In the 99.99% of uses where you want a single case to be executed, these result in exactly the same code. In Pascal, the compiler knows to put the GOTO there for you. In C you put the BREAK there yourself. Either should result in exactly the same machine code given reasonable compilers on either side. In the very rare instance you really do want to fall thru to the next case, in C you leave out the BREAK and in Pascal you write a GOTO and add a label at the beginning of the next case. Here it does take just a little more cleverness from the compiler to realize it is doing a GOTO to the next instruction, but any even moderately reasonable compiler will detect and handle this case. If nothing else, the peepholer should catch this. So again, the same machine code will be generated, but the Pascal syntax is a lot better in preventing human errors in the first place and in detecting them when they do happen. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist