[NCLUG] Looking at programming languages...

Chad Perrin perrin at apotheon.com
Wed Jan 16 13:21:57 MST 2008


On Wed, Jan 16, 2008 at 11:53:29AM -0700, Alan Silverstein wrote:
> My $0.02...  I happen to have recent experience using both Perl (a lot)
> and Ruby (a little) in my contract job, where we do a lot of Linux (RH3).
> 
> > PERL - Available everywhere, easy to write.  The GUI stuff, though is
> > kind of convoluted for n00b's, and it tends to be a write only
> > language.
> 
> For the sake of discussion here, but to be blunt:  To me, a comment like
> this says you aren't disciplined and thoughtful enough when you write
> the program.  Which, in my opinion, seems to be true of 90% of all
> programmers.  (It amazes me what mind-to-mind unportable garbage is
> produced by so-called professionals, highly paid, who can't seem to
> express themselves clearly, even when it counts.)
> 
> That said, Perl is certainly a language that, like C++, INVITES people
> to write garbage.  "Look how clever I can be..."
> 
> But nothing says you MUST be sucked in by the dark side of the Force.
> Thoughtful consideration of commenting, formatting, choice of methods
> and object names, etc, can produce code that anyone reasonably
> comfortable with the language should be able to read.

Agreed.  Perl itself (and it's called Perl, not PERL) is *not* a
write-only language.  There are, however, write-only programmers, and
Perl suffers reputation-wise from the fact that people have noticed some
of the write-only programmers that use Perl.  This is not a language
characteristic by any means.

Also . . . GUI stuff is pretty much always "convoluted for" new users.
The only exception is GUI-only IDEs that optimize for the simplest common
case of GUI design and do not really foster good programming practice
"under the hood".

The major problem with Perl is that its object model is bolted on and
kind of painful to use.  It is, to some extent, modeled off Python's
object model, but suffers in implementation from being an afterthought so
that it is not as clean an implementation as Python's -- and ends up
being quite fugly.  Aside from the atrocious Matt's Script Archive, the
ugliness of Perl's OOP syntax may be the biggest contributor to Perl's
poor (and mostly undeserved) reputation.


> 
> > Ruby - The language is brilliant.  It does everything just as you
> > would want and expect.
> 
> Eh?  In my limited experience, the actual syntax is stupid, and the
> error messages are terrible.  (Don't ask me to elaborate, though, it's
> been a while.)  I was underwhelmed, it looked like another hack job, a
> "doctoral dissertation", where, like ksh, the features were cool and you
> couldn't help wanting to use the tool, but you'd always hate the lack of
> "end user friendliness," the purposeful or mindless snobbery of the
> authors.  You know, "This is good enough for me, I like it, what's your
> problem?  No one is forcing you to use it."  What I call "software
> macho."

The syntax is beautiful.  You just need to get into its mindset -- just
as you need to get into a line-oriented brain-dead mindset to use BASIC
effectively, or a list-oriented parse tree structured mindset to use
Common Lisp effectively.  Then again, I've never used any Ruby older than
1.8.x, and if your experience is from an older iteration of the language
than that, we might effectively be talking about different languages.


> 
> Maybe I'm weird, but I don't consider my software a success unless it
> seduces users into wanting to use it, and even enjoying the experience.
> Likewise, I want people reading my programs to say, "yeah, I followed
> it, so what?..."  Which is about the highest praise you can ever get.

That's exactly the experience I get from Ruby, generally speaking.  For
very simple programs on the level of glorified shell scripts, Perl is
probably better.  Perl and Ruby are roughly equivalent in my experience
for anything from that point up to about 100 lines or so, in that range
where higher-order functions can in and of themselves completely
transform the programming experience (and both languages provide elegant,
powerful abstractions for higher-order functions, first-class functions,
et cetera).  It's at the point where object oriented programming starts
to yield real benefits that Ruby starts looking like the clear winner in
a comparison with Perl, largely because Perl does a mediocre job (at
best) of handling OOP syntax, while Ruby's object model is implemented
beautifully both in terms of syntax and semantics.

So . . . yeah, Ruby "seduces" me into wanting to use it, and ends up
being eminently readable except in the case of obstinately write-only
programmers.

Hmm.  Maybe your problem with Ruby was the same problem some people have
with Perl; perhaps you tried parsing code produced by write-only
programmers.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
Dr. Ron Paul: "Liberty has meaning only if we still believe in it when
terrible things happen and a false government security blanket beckons."



More information about the NCLUG mailing list