Psychos and code

I was researching a programming issue today and came across this fantastic quote from a usenet post in 1991, still good advice today:

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.  Code for readability.”
– John F Woods

For those who may be interested and were curious about the context, here is the full post:

Path: gmdzi!unido!mcsun!uunet!ksr!jfw
From: j...@ksr.com (John F. Woods)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Usage of comma operator
Message-ID: <5598@ksr.com>
Date: 24 Sep 91 17:55:37 GMT
References: <1991Sep19.022147.16089@msuinfo.cl.msu.edu> <1991Sep19.053910.2431@uokmax.ecn.uoknor.edu> <robtu.685300138@mexia> <1991Sep24.112428.23020@odin.diku.dk>
Sender: ne...@ksr.com
Lines: 24
Xref: gmdzi comp.lang.c:108224 comp.lang.c++:55004

ju...@diku.dk (Anders Juul Munch) writes:
>ro...@itx.isc.com (Rob Tulloh) writes:
>spco...@uokmax.ecn.uoknor.edu (Steve Coltrin) writes:
>>la...@lobster.cps.msu.edu (Mark M Lacey) writes:
>Mark>I was wondering why it seems that the comma operator is so rarely used.
>Mark>The only time I ever see it is in 'for' loops.  Is it really considered
>Mark>*that* bad by the programming public at large?  Any comments?
>Rob>Well, I hadn't seen it used much either outside of the for loop, but
>Rob>in Plaugher's latest book I discovered quite a few of the following
>Rob>constructs:
>Rob>	if (condition)
>Rob>		var = value, anothervar = anothervalue;
>Rob>This does away with the need for braces. I am tempted to use this myself
>Rob>unless someone has a good point agains using this style. Opinions anyone?
>Consider this:
>	if (condition)
>		var = value; anothervar = anothervalue;
>Only one little dot is changed, but the meaning is quite different. In other
>words, using the comma operator like that makes it harder to read:

Right.

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live.  Code for readability.

You can see the full original post here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s