You are not logged in.

#1 2009-07-16 18:25:13

luskjh
Member
Registered: 2009-03-24
Posts: 19

The General Feeling Around Perl

Hi,

I have got the feeling at one time or another that some people have a high dislike of Perl.  Granted, I don't think everyone thinks that, but their seems to be a general feeling that Perl code is "sloppy" or "unreadable."  Now, yes, their is sloppy Perl code out there, but doesn't every language have sloppy code, because every language has sloppy coders?  Or does Perl just have a surplus of sloppy coders big_smile ?

I was just wondering if someone could shed some light on this.

Thanks smile.

-Josh


Calm down, it is only ones and zeroes.
       -flyingfsck ( on /. )

Offline

#2 2009-07-16 18:47:07

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: The General Feeling Around Perl

Its not so much that Perl is 'sloppy' as there are so many ways to write perl; two coders could do the same task in perl and come up with programs the other person can't read! It also doesn't seem to encourage 'unsloppy' code, its kind of an anything goes sort of language.

For the most part, when I think of perl coders, I think of 'old guys'. :-P I write perl on occasion, but I'd never call myself a perl programmer.

Dusty

Last edited by Dusty (2009-07-16 18:47:30)

Offline

#3 2009-07-16 18:53:00

buttons
Member
From: NJ, USA
Registered: 2007-08-04
Posts: 620

Re: The General Feeling Around Perl

Oh boy. This is going to be an interesting thread.

I was a perl head for several years. Like you mentioned, a language is only as 'sloppy' as the coder...people can write horrible, unmaintainable code in any language.

But perl really encourages it.

The whole mantra, TIMTOWTDI, lets the programmer get away with any little gimmick s/he wishes, provided one is feeling lazy at the time. And let's not forget: Laziness is one of the virtues of a programmer! Over time, these accumulate.

"Oh, that doesn't work? I'll just do it this way for now and change it later..."

There were two milestones that caused me to drop perl, pick up python, and never look back:
1) I managed to 'debug' something by rewriting it in exactly the same logical progression, but using another method. And it worked.
2) I found a piece of code that I had been very proud of at the time. Fully commented, and (I thought) well-structured. And couldn't figure out what the hell I'd been doing.

That said, I still use perl AS IT WAS INTENDED: as a sed/awk replacement. It makes beautiful one liners.

Last edited by buttons (2009-07-16 18:55:01)


Cthulhu For President!

Offline

#4 2009-07-16 20:16:07

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: The General Feeling Around Perl

Perl doesn't really enforce good programming practices by itself.  Features like autovivification of variables (variables that spring into existence when accessed), barewords treated as strings, parentheses being optional around argument lists, and others can mean that a program appears to do one thing while actually doing something entirely different.  (That's why the first two features are turned off under 'use strict'.)  It's REALLY EASY to write horrible, unmaintainable code with Perl that you would think twice about before implementing in Java, Python, or even C.  Also, some of the language's features (notably the OOP features) feel like they were slapped on as an afterthought.

That said, it's a perfectly good language and I think the connection with natural languages is particularly interesting.  I use Perl for short command-line scripts that primarily deal with lines of text.  Anything with a GUI, or with object-oriented design, or longer than (say) 20 lines, falls into the realm of Python.

Offline

#5 2009-07-16 22:04:16

benob
Member
Registered: 2008-11-11
Posts: 187

Re: The General Feeling Around Perl

For processing big text files, perl is much faster than python. I like perl for hacking quick scripts to change the format of something (basically when it becomes to be too much of a headache to do it in shell). Perl also has a huge codebase with the cpan. If you want to do something, it's quite likely to be already in the cpan.

That said, I have never been able to maintain a big project in perl. Python and other do a much better job.

Offline

#6 2009-07-16 23:24:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: The General Feeling Around Perl

Recently my opinion has been changed a bit becuase of a guy in my office that uses perl.  Looking at his code, it was very clean a readable.  So I think perl has a bit of a bad name because the "bad" code gets more publicity.

Offline

#7 2009-07-17 00:11:19

ent
Member
Registered: 2008-12-15
Posts: 53

Re: The General Feeling Around Perl

I regard perl as kind of like duct tape: you can throw together / fix anything with it, but you wouldn't want to build a car out of it (actually, my old bronco was pretty much covered in duct tape... maybe that's why I like perl so much tongue )

Offline

#8 2009-07-17 00:56:14

arkay
Member
Registered: 2008-05-23
Posts: 79

Re: The General Feeling Around Perl

I think perl gets a bad wrap.  It's a fantastic language that isn't so tied to all this oo rubbish.  I think oo has it's place but these days there doesn't seem to be any focus on procedural code and it still has a place as far as I'm concerned.  It's like 2D/3D gaming.  Once 3D came along all the greatness that was 2D was forgotten and games that were great 2D games that could never work in 3D were still made 3D because it was the buzz.  Now we're at the point that good 2D performance is 100% reliant on a good 3D card.  i.e. XBMC requiring openGL 2.0 to render it's 2D menus..  Anyway.  I digress.  Perl is fantastic and you can do anything with it (including some very nice GUI code).  To me it feels far more "unix" and integrated than python or any of these newer OO focussed languages.

Cheers,

Arkay.

Offline

Board footer

Powered by FluxBB