Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!ames!ucbcad!ucbvax!cbosgd!osu-cis!tut!lvc From: lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) Newsgroups: comp.lang.c Subject: Re: Language-induced errors Message-ID: <4349@tut.cis.ohio-state.edu> Date: 13 Jan 88 01:18:18 GMT References: <4668@pyr.gatech.EDU> <495@xyzzy.UUCP> <9930@mimsy.UUCP> <18515@bu-cs.BU.EDU> Organization: Ohio State Computer & Info Science Lines: 38 Summary: mainly typos not bad programmers In article <18515@bu-cs.BU.EDU>, hen@bu-cs.BU.EDU (Bill Henneman) writes: > In article <609@PT.CS.CMU.EDU>, edw@IUS1.CS.CMU.EDU (Eddie Wyatt) writes paragraph by Eddie Wyatt on programming environments deleted > > Are there programmers who really have trouble with this? I know a > fair number of C programmers (i.e., people who are paid to produce > code), and none of us find these kinds of things to be sources of > error. Those of us with the most experience with other languages took > the longest for that to stop being a source of error - about half a > day. By the time we had run the exercises in Chapter 3 of K&R, this > sort of error was about as likely as my saying *DO* or *LOOP* when I > mean *FOR*. > > Is my experience unique? Is there something in the air in Boston that > makes us immune to this sort of error? > > Skeptical in Kenmore Square Must be the air in Boston :-). I don't think there are many programmers that really have trouble with this (for long), its just when you have been typing at a keyboard for a long time it becomes easier to slip up. I don't believe anyone is immune from this, except maybe Dennis Ritchie :-). How are you certain that these mistakes weren't made? How should a language be designed so that these errors are hard to make (would be an interesting thesis topic)? I'd rather have the power without the syntactic seat belts and have a syntax checker to verify the code. Other common "typos" in C are extra semicolons after if while for and else, dangling elses (many programming languages have this problem), missing parenthesis in expressions resulting in fouled up precedence, using a bitwise or when a logical or was intended, ditto for bitwise and, nesting comments, etc etc. I mentioned in another posting a syntax checker called inspect that I wrote in another article that checked for this sort of stuff in C and C++. I ran it on many different versions of the UNIX operating system, and found bugs in every one of them. There weren't a lot of bugs, though some of them were major problems.