[LUNI] Linux Programming

Steven Lembark lembark at wrkhors.com
Fri Mar 8 09:40:01 CST 2002


-- scott thomason <scott at thomasons.org>

> On Mar 08 07:58 AM, Martin Maney wrote:
>> Pardon me for saying it, but you sure make it sound like you would be a
>> poster child for The Problem Of Write-Only Code.  :-/
>
> Don't get me wrong; I _almost_ always indent in a manner compatible with
> Python. I just don't like the idea of being forced into it. Sometimes
> I might just want to do something like:
>
>     if (true) { one-statement; }
>
> ...if the situation calls for it. Of course, Perl kinda shines here
> because it supports that situation more directly by being capable of
> saying:
>
>     one-statement if true;
>

Main point w/ Perl is that the programmer has the option
of doing things how they feel is best. If you don't want
programmers to have control over the code why not just use
automatic code generation and be done with it?

I also find it a hassle to deal with any language that
fails when the source is edited successively in vi and
then emacs (or on a dos-based file system).

One SysAdmin I know is blind. He listens to the code.
Either he has to spend his entire life listening to
"tab tab tab tab tab tab" or just make a reasonable
attempt at the alignments. He can't program Python
worth a damn; Perl works fine for him (along with C).

These are a few reasons I find it easier to teach Perl
as a first language: Most of the coding effort goes
towards productive work rather than syntatic sugar.
Learning Java as a first language faces much the same
problem. Compare the amount of code it takes to just
'print "Hello, world!\n";'. I also don't have to spend
a lot of time differentiating integers, chars and floats
to people who just want to add two numbers -- or read
in "20" from a flat file and double it to get 40.

The other nice thing about Perl on *NIX is that you get
much of the C std library and unistd.h built into the
language (e.g., link, unlink, symlink, directory and
file tests). Intuitions based on C or shell operations
translate directly into Perl code. This makes it easier
to actually write code that does something useful early
in the learning cycle (e.g., scan a directory for files
containing "Hello, world!"). Combined with the portability
to windog & Mac platforms this allows people to walk up
and deal with realistic problems quickly.

enjoi.

--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 800 762 1582



More information about the luni mailing list