Re: [Nolug] Language philosophy

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 13 Jul 2003 01:26:06 -0500
Message-Id: <1058077565.18887.163.camel@haggis>

On Sun, 2003-07-13 at 00:20, Mark A. Hershberger wrote:
> Ron Johnson <ron.l.johnson@cox.net> writes:
>
> >> If you have the capability to program quickly, but feel constrained
> >> to program slowly to accommodate some unknown future reader, you are
> >> only hurting yourself and whoever you are writing the code for.
> >
> > No, I am creating a net benefit. As soon as I had to read my own
> > code, 6 months and 3 projects after I last thought about it, I cursed
> > myself for being "clever".
>
> I'll admit my limited experience here. I do have code sitting on
> CPAN that I originally wrote several years ago. But, I can still
> read it when I go back to it to fix a bug or add a feature.
>
> I guess I just don't get what people are talking about when they say
> they can't read code they wrote a few months ago. I don't recall
> ever having this problem.

You're obviously much more intelligent than most programmer, including
me. It takes time looking at the code to reaquaint yourself with
your old code (or grok code you've seen for the 1st time).

When under time pressure, anything that minimizes the amount of work
that I have to do, like remembering non-intuitive language features,
function return values, etc., is a benefit to me, because it's one
less thing I have to think about, thus letting me get my task done
more quickly.

> >> By the way, The best book for understanding Perl Idioms (what you call
> >> "clever" programming) is Effective Perl Programming. At under 250
> >> pages, it is relatively thin.
> >>
> >> Highly recommended.
> >
> > I'll check it out. Is it written for non-Perl-newbies?
>
> If I recall correctly, yes. But I'm not positive. A co-worker has
> the book. I'll try to look at his copy on Monday.

Thanks.

> > It's the programmer's attitude, not the language, that makes
> > something unmaintainable. However, any language (C is a prime
> > example) that hands you tequila and a gun, and takes your shoes
> > and pants off, should be used with circumspection.
>
> Since we're talking about Perl here, does this mean that you think
> Perl is as similar to C in this regard?

Here's a *totally* subjective opinion: every language has a zen.
The zen of COBOL and PL/1 is to be wordy. The zen of Python is
ambiguous; you can use lots of lambdas and short variable names
and your LOC will plummet, or not. The zen of C is, as I said
before, to give you tequila, a gun and help you aim it at your
thigh. The zen of Perl seems to encourage RS-232 line noise.

> Does Python, for example, automagically figure out when you are trying
> to use more memory than you have available?

I'm sure it raises an OutOfMemory exception, but, being an inter-
preted language with gc, it tries to stave off that event for
as long as possible.

> > For example, we developed a customer service app. Purely record
> > oriented, no "bit fiddling". But, some brainless manager said,
> > "C is portable, use it!"
>
> I love managers. They're so ... smart.

And the sad fact is that he's a nice guy. If not for him, I
wouldn't be telecommuting. Since I refuse to move to NY, I'd
have had to quit, and probably find a lower paying local job.

> >> I wouldn't hire a newbie Python programmer to maintain my code, so
> >> why should I feel sympathy for someone who hires an incompetent Perl
> >> programmer?
> >>
> >> I know quite a few extremely competent Perl programmers.
> >
> > Ok, hire all Perl Wizards. Then, when you leave (for whatever
> > reason), and, somehow, a competent non-Wizard somehow gets hired,
> > he's stumped, and, under pressure to make the changes, does what
> > looks right, and a subtle bug gets introduced
>
> I guess its a good thing I'm in no position to hire anyone, eh?
>
> Seriously, I didn't mean that you should only hire wizards. But,
> anyone with a few years worth of Perl should be capable of
> maintenance. They should also be capable of producing their own code.

As I said before, given enough time, any competent programmer
can maintain any code. But unless you work on an OSS project,
you don't have unlimited time. Thus, I program "simple", so
that I, or someone else, can *quickly* understand my logic.

That there is the bottom line, IMO.

-- 
+-----------------------------------------------------------+
| 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