home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!sgiblab!munnari.oz.au!metro!atom.ansto.gov.au!teslab!andrew
- From: andrew@teslab.lab.oz.au (Andrew Phillips)
- Newsgroups: comp.lang.c
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <4494@teslab.lab.oz.au>
- Date: 19 Nov 92 00:34:14 GMT
- References: <2184@ontek.com>
- Organization: Technology Services, Chief Secretary's Dept, Sydney
- Lines: 46
-
- mikey@ontek.com (euphausia superba) writes:
- : [How a coding conventions should not be enforced because the style
- : can be used to identify the author of the code.]
-
- With the greatest respect, I submit that the style of code is a very
- poor way of identifying an author. Apart from the flaws that you
- mention there is also no guarantee that the programmers will use
- different styles or be aware of what other peoples styles are. Is
- there some problem with you compiler that it doesn't accept comments.
-
- Proper use of a source code control system would allow you to
- identify who wrote at least large chunks of code. With very small
- pieces there would not be enough to code to detect a style anyway.
-
- My final question is, why do you need to know who wrote the code, if
- it is well written and documented. In a company I worked for it was
- policy that the author of code NOT be identified. This was to
- encourage people to write code just to get the job done and not to
- spend a lot of time writing code just to impress others. Personally
- I think there are valid reasons for needing to find who wrote a bit
- of code. Of course, this company is probably very different to yours
- - having a high turnover of staff the chances were high that the
- original author could not be located anyway.
-
- As far as the advantages of code conventions goes I think that
- readability can not be emphasized enough. Not only does it save time
- and frustration it can help avoid some nasty bugs. And after all
- most of us use some conventions which would otherwise make software
- completely unreadable, although I have seen code like this:
-
- f()
- {
- while (x)
- {
- i=10;
- for (j=1; j<i; ++j)
- {
- if ()
- { xxx;
- if ()
- { yyy;
- }}
- }
- }}
- --
- Andrew Phillips (andrew@teslab.lab.oz.au) Phone +61 (Aust) 2 (Sydney) 287 6551
-