Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion "Religious" C question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Pop  
View profile  
 More options Oct 2 1994, 3:35 am
Newsgroups: comp.lang.c
From: dan...@cernapo.cern.ch (Dan Pop)
Date: Sat, 1 Oct 1994 18:01:05 GMT
Local: Sat, Oct 1 1994 2:01 pm
Subject: Re: "Religious" C question
In <tyronaut.47.000C6...@irisdav.chem.vt.edu> tyron...@irisdav.chem.vt.edu (Tyronaut) writes:

>In article <35ncdr$...@wsinti05.info.win.tue.nl> ha...@wsinti05.info.win.tue.nl (Hans Mulder) writes:

>>        -- Henry Spencer, "The Ten Commandments for C Programmers"

>Do you happen to have the other nine?  I would like to post them in the
>computer room I work at.

The Ten Commandments for C Programmers
Henry Spencer

1. Thou shalt run lint frequently and study its pronouncements
with care, for verily its perception and judgement oft exceed thine.

2. Thou shalt not follow the NULL pointer, for chaos and madness
await thee at its end.

3. Thou shalt cast all function arguments to the expected type if
they are not of that type already, even when thou art convinced that
this is unnecessary, lest they take cruel vengeance upon thee when thou
least expect it.

4. If thy header files fail to declare the return types of thy
library functions, thou shalt declare them thyself with the most
meticulous care, lest grievous harm befall thy program.

5. Thou shalt check the array bounds of all strings (indeed, all
arrays), for surely where thou typest 'foo' someone someday shall
type 'supercalifragilisticexpialidocious'.

6. If a function be advertised to return an error code in the event
of difficulties, thou shalt check for that code, yea, even though the
checks triple the size of thy code and produce aches in thy typing
fingers, for if thou thinkest 'it cannot happen to me', the gods
shall surely punish thee for thy arrogance.

7. Thou shalt study thy libraries and strive not to re-invent them
without cause, that thy code may be short and readable and thy days
pleasant and productive.

8.  Thou shalt make thy program's purpose and structure clear to thy
fellow man by using the One True Brace Style, even if thou likest it
not, for thy creativity is better used in solving problems than in
creating beautiful new impediments to understanding.

9. Thy external identifiers shall be unique in the first six
characters, though this harsh discipline be irksome and the years of
its necessity stretch before thee seemingly without end, lest thou tear
thy hair out and go mad on that fateful day when thou desirest to make
thy program run on an old system.

10. Thou shalt foreswear, renounce, and abjure the vile heresy which
claimeth that 'All the world's a VAX', and have no commerce with the
benighted heathens who cling to this barbarous belief, that the days of
thy program may be long even though the days of thy current machine be
short.
--
Dan Pop
CERN, CN Division
Email: dan...@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.