Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!news.cs.indiana.edu!uceng!minerva!dmocsny From: dmocsny@minerva.che.uc.edu (Daniel Mocsny) Newsgroups: comp.lang.c Subject: Re: Coding Standards. was: a style question Message-ID: <6733@uceng.UC.EDU> Date: 17 Nov 90 14:11:26 GMT References: <1990Oct23.160116.10299@athena.mit.edu> <13@christmas.UUCP> <14369@smoke.brl.mil> <1990Nov10.191840.21113@clear.com> <7267@hub.ucsb.edu> Sender: news@uceng.UC.EDU Organization: University of Cincinnati, Cin'ti., OH Lines: 67 In article <7267@hub.ucsb.edu> 6600dt@ucsbuxa.ucsb.edu (David Goggin) writes: >In article <1990Nov10.191840.21113@clear.com> rmartin@clear.com (Bob Martin) writes: >>At Clear we have instituded a style standard which >>all our engineers follow. > >I don't think I'd >like to have a format forced on me like that. But by deviating from the standard, you are forcing additional noise and complexity on everyone who needs to read your code. Even a fairly poor standard will beat no standards almost every time, provided that the poor standard begins with a large-enough share of the user base. The standard then becomes the language that enables the users to share ideas with each other. Like any communications system, the overall value of the system is in direct proportion to the number of subscribers. For example, consider the english language (and associated dialects, such as all the USA varieties). What a mess---hundreds of irregular verbs, a hopelessly irrational non-phonemic alphabet, an enormous number of grammatical and pronunciation rules which it violates constantly, etc. Any person with a shred of logic would understandably hate to have such a standard imposed on them. The logical person would chuck this bloated, inconsistent monstrosity and start over with something simple and elegant, such as esperanto or loglan. Yet english, with all its obvious warts and shortcomings, is quite simply THE most valuable language to speak. This does not follow from any inherent advantage of the language. Rather, it follows from who happens to be speaking the language. And humans, being such marvelously adaptive creatures, are quite capable of tolerating the flaws of english and using it to advantage in spite of them. If everybody who didn't like the details of the language decided to change them as they saw fit, what would happen to the language? It would become worthless. Fragmentation doesn't always kill computer languages, of course, because the computer can be made to "understand" any dialect. But fragmentation does reduce the value of a computer language as a means for communication between programmers. As long as we insist on creating code of potential value to more than one person, this will be an important consideration. > I >think, however, I _well-designed_ standard does go a >long way in clearing up the problem. I would >reccommend a standard that is thought out carefully >in advance, to be most logical in showing the >structure of code, as well as aestheticaly pleasing >(a big factor for me.) The situation for programmers is better than for natural-language speakers, because automated formatting tools can allow individual programmers some latitude for expression, while still retaining compatibility with the standard. For example, the details of indenting belong in a pretty-printing program (or language-sensitive editor, for that matter). I can think of no reason to impose any particular indenting style on a programmer, because a quick run through a standardizing beautifier will repair any idiosyncrasy. -- Dan Mocsny Snail: Internet: dmocsny@minerva.che.uc.edu Dept. of Chemical Engng. M.L. 171 dmocsny@uceng.uc.edu University of Cincinnati 513/751-6824 (home) 513/556-2007 (lab) Cincinnati, Ohio 45221-0171