Re: [Nolug] Crappy Perl Code

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 13 Jul 2003 01:44:45 -0500
Message-Id: <1058078685.18887.182.camel@haggis>

On Sun, 2003-07-13 at 00:41, Mark A. Hershberger wrote:
> Ron Johnson <ron.l.johnson@cox.net> writes:
[snip]
> >> And my point was that you shouldn't expect a newbie to maintain code
> >> written by a guru, no matter what the language.
> >
> > But the guru should not presume that only gurus will ever see or
> > have to maintain his code. That's the issue, as I see it.
>
> So, I think we can safely conclude that some programmers have a bad
> habit of writing code no one can read. God help them.

No, $DEITY help me, when I have to pick it up and grok it with the
customer breathing down my neck.

> People experienced at programming (at least, those who've worked with
> others for any period of time) should've recognized this long ago and
> begun to write code that is readable by many.

Shoulda, coulda, woulda.

Most people, especially busy, mediocre programmers, and SysAdmins
who hack out what they think are one-time scripts that somehow
wind up still in production 3 years later, only think of the moment.

> Still, sometimes you want to read a good novel instead of the
> newspaper. Or maybe yu want to write a good novel.
>
> That is, newspapers are written at the 6th grade reading level or
> lower. Novels can be written at whatever level the capabilities of
> the author are.
>
> In the same way, you should keep your audience in mind when writing
> code. Not only the user-base, but the code-readers (maintainers) as
> well.

Unfortunately, that analogy breaks down at the comparison to a
novel. All code can be changed/upgraded, whereas a novel can't.

Also, please note that I am a firm believer in intelligent programming.
To follow the newspaper example: a newspaper that writes to the
6th grade level uses simple words and simple sentence structures.

If I were to write for the newspaper, I would use "college words"
in moderate length sentences, with good grammar.

The "clever" programmer, well, the analogy breaks down there.

> How's that for consensus?
>
> What I hear, though, is that all programs should be written as
> newspaper articles -- to the lowest common denominator. Ok, I can

No, see above.

> accept that for a day-job. But, why constrain myself when I'm writing
> the equivalent of the Great-American Novel?

I guess it depends on what you think is a Great Novel. James
Joyce's Ulysses or Tolkien's LOTR.

-- 
+-----------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net          |
| Jefferson, LA  USA   http://members.cox.net/ron.l.johnson |
|                                                           |
| 4 degrees from Vladimir Putin
+-----------------------------------------------------------+
___________________
Nolug mailing list
nolug@nolug.org
Received on 07/13/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST