HP3000-L Archives

November 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Neil Armstrong <[log in to unmask]>
Reply To:
Neil Armstrong <[log in to unmask]>
Date:
Tue, 20 Nov 2001 11:25:57 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (67 lines)
At 09:44 AM 11/20/2001 -0500, Ted Ashton wrote:


> >       I also keep hearing about it being readable, but I've never seen a
> > single readable piece of Perl code yet.
>
>Isn't this just a little like saying, "I've never learned to read Russian and
>I've never seen a single readable piece of Russian yet"?

I would disagree with this sentiment, in fact what makes an outstanding
programmer from an average programmer is making the "Russian" (code)
more readable:

Consider the following bit of code: (pick your favourite language)

What I consider not so good code:

if x >= 4500 and y >= 5100 then {
    j := 123;
} else {
    k:=456;
}

Code that I like:

if version'number >= 4500 and product'option >= 5100 then
{
    intial'parameter := 123;
}
else
{
    end'parameter :=45;
}

The reason I like the second example are that the begin and end's line up and
the variable names are more meaningful. I think this is the "art" portion
of computer science, whereby code (whatever language) is much
more readable.  I admit that my examples of good vs bad code could be
much better, but I just wanted to make the point that programmers can
make a huge difference in making their "Russian" much more readable.

I recognize that the lining up of begin and end constructs is more of a
style choice, but personally, I find code that does use indentation and
lining up of begin and end constructs much easier to read, whether it
is Java, Perl, C or even good old SPL.

Neil




>Ted
>--
>Ted Ashton ([log in to unmask]), Info Sys, Southern Adventist University
>           ==========================================================
>The words figure and fictitious both derive from the same Latin root,
>fingere. Beware!
>                         -- Moroney, M.J.
>           ==========================================================
>          Deep thought to be found at http://www.southern.edu/~ashted
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2