Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/12/84; site desint.UUCP Path: utzoo!utcs!lsuc!pesnta!pertec!scgvaxd!trwrb!desint!geoff From: geoff@desint.UUCP (Geoff Kuenning) Newsgroups: net.lang.c Subject: Re: Quality programming in c -- a rarity? Message-ID: <333@desint.UUCP> Date: Wed, 6-Feb-85 14:32:56 EST Article-I.D.: desint.333 Posted: Wed Feb 6 14:32:56 1985 Date-Received: Fri, 8-Feb-85 02:34:43 EST Organization: his home computer, Manhattan Beach, CA Lines: 28 >In other words, if those who write Unix utilities, surely the >top level of C hackers, routinely write bad code -- maybe some sort >of restrictions in the language are necessary to help people? There is an unfortunate assumption here, and that is that the Unix utilities were written by a bunch of superprogrammers who were C experts. But in fact, the utilities show a wild variation in the abilities of their authors. Some of the code is indeed superb, but most of it is an example of how to write unreadable C. This is entirely to be expected. Bell Labs is a research organization; most people were not especially interested in writing the most maintainable code possible. Many utilities were written by someone who needed them to get a bigger job done; frequently that person did not take the time to coordinate their design decisions with the people down the hall (cf. join, cut, paste, sort, grep, uniq, and comm). Others were written as an exercise in learning C, or by people who were not full-time professional programmers. It is possible to write bad code in any language. C is perhaps more conducive to this than other languages, and perhaps could stand improvement in this area. But please don't use the Unix sources as an example of what really well-written C can look like. Contrast the recently-posted public-domain terminfo sources for a look at what a conscientious programmer produced. -- Geoff Kuenning Unix Consultant ...!ihnp4!trwrb!desint!geoff