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: <firstname.lastname@example.org> Date: 24 Sep 91 17:55:37 GMT References: <1991Sep19.email@example.com> <1991Sep19.firstname.lastname@example.org> <robtu.685300138@mexia> <1991Sep24.email@example.com> 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.