Olin Lathrop wrote: > Gerhard Fiedler wrote: >> Of course. The more redundant (that is, verbose) the syntax is, the >> easier it is both for the programmer to get something wrong and for >> the compiler to catch when something is wrong. > > Not necessarily, and this is one of the problems with C. What "not necessarily"? Sometimes, it seems you don't really try to understand and go against, just because... :) > It's not always as obvious to a human when the wrong special character > is used, for example, than a more verbose keyword. This is what I wrote: the more verbose, the easier to catch ("more obvious") when something is wrong. > It is easier to get "{" or "}" wrong than the more verbose "begin" or > "end", for example. I think here you're wrong. The probability to type a wrong letter is about the same per letter, so the probability to type "begin" wrong is higher than the probability to type "{" wrong. > The latter are bigger patterns to match against and more obvious when > they are wrong, especially to a casual observer. Exactly... for the reviewer or for the compiler, it's much easier to catch the error with "begin" than with "{". This is what I wrote. So again: what "not necessarily"? > I had exactly this case last week. I added one more symbol to a C > ENUM, and apparently typed ")" instead of "}" to close the list. > These two look fairly similar, so I didn't notice. That, and the > fact that I don't do C that often caused several wasted minutes > trying to figure out why the code wouldn't compile. The C18 > compiler's cryptic "syntax error on line xxxx" didn't exactly help > either. It seems that the compiler didn't have a problem detecting that there was something wrong. That the compiler didn't provide you with a helpful error message is another issue -- that's not a problem with language syntax but with the specific compiler implementation. > I'm pretty sure that if I had been required to type END or something > more verbose than "}", the mistake would never have happened or I > would have noticed it much quicker. You can define preprocessor macros and use Begin and End instead of { and }. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist