Hacker News new | past | comments | ask | show | jobs | submit login
Why I Stuck With Perl (perl.org)
66 points by nkurz on Jan 23, 2011 | hide | past | favorite | 27 comments



My reason for using Perl is to escape from OOP. All of the modern mainstream programming languages, C++, Java, C#, Python, Ruby, JavaScript, etc are all strongly OOP.

On the other hand, Perl is very much a procedural langauge. Besides Perl code that is written in a procedural style, many Perl modules are written in C which is a strictly procedural language.

There is Moose for OOP stuff, but that is just added onto the language as an afterthought, and many libraries don't use it so we can at least say that Perl is less OOP then all of the other mainstream languages.

I don't know what it is, I just hate OOP. It seems absolutely revolting to me, so I stuck with procedural languages. Now I have found something I like even better: functional programming, so now I use languages like Lisp and Haskell.

As for Python, the only good features in that language: lambda, map, reduce, and filter were added by a Lisp hacker. Everything else in the language is inefficient scripting crap.


> As for Python... Everything else in the language is inefficient scripting crap.

Would you elaborate on how this applies to Python and not Perl?


Perl is terse, and fast. The speed difference between perl and python might mean peanuts these days, but it's still true more often than not. Perl programs kick off far faster for instance (`time perl < /dev/null` `time python < /dev/null`) which can become important in some (not so hard to imagine) situations.

Perl also functions far better as a systems scripting language. Compare filtering a perl string through a Unix filter (perhaps an Awk program, another perl program, whatever) to the same thing in python. The difference is night-and-day.


  $ time perl < /dev/null

  real	0m0.033s
  user	0m0.004s
  sys	0m0.000s
  $ time python < /dev/null

  real	0m0.017s
  user	0m0.004s
  sys	0m0.012s
  $ time perl < /dev/null

  real	0m0.002s
  user	0m0.004s
  sys	0m0.000s
  $ time python < /dev/null

  real	0m0.017s
  user	0m0.016s
  sys	0m0.000s
  $ time perl < /dev/null

  real	0m0.002s
  user	0m0.000s
  sys	0m0.004s
  $ time python < /dev/null

  real	0m0.017s
  user	0m0.008s
  sys	0m0.008s
That's interesting. The first time perl is a lot slower, but further runs are a lot faster, while python starts medium and stays there. I tested this on more than one computer and results followed the same pattern.


I think the delay is the seek time of your disk the first time it loads perl; and the python was already cached.

(OT: the Lua startup time is half of Perl's)


Even so, with either one at such negligible speeds, that has to be about the worst justification for any language I've heard.


The difference is that Perl got its good features from non-Lisp hackers that copied Lisp. Python got its good features directly from Lisp hackers.

I am quite certain of this because I doubt there are any Lisp hackers out there that would contribute to a language that has a periodic table of unreadable operators

http://glyphic.s3.amazonaws.com/ozone/mark/periodic/Periodic...


Python got its good features directly from Lisp hackers.

Perl 5 has more Lisp features than Python does.


Sigh, another language war troll that don't know that table is for Perl 6 and not for Perl 5... :-(

Can't you guys at least vary your garbage? (Assuming it isn't one guy with multiple accounts everywhere.)


I am very aware of the differences between Perl 5 and Perl 6. Perl 5 was a tool that was very useful for obfscuated code contests such as this one:

http://perl.plover.com/obfuscated/

The new version of Perl, Perl 6, introduces new features to Perl 5 that will make it an invaluable tool for obfuscated code contests such as unicode characters (you thought you had to decipher the meaning of only 256 characters? Think again) and meta-operators. Perl 6 obsoletes Perl 5 for these contests, even brainfuck is no longer a useful tool for obfuscated code contests, because it is no match for Perl 6.

Lisp isn't very useful for these obfuscated code contests, but if you are interested in actually writing computer programs then its worth looking into.


And now this new account claim, that if you can misuse a tool, it is bad (please hand over all your kitchen knives).

>>Lisp isn't very useful for these obfuscated code contests

I quite like Lisp. I still am quite certain that nice macro system can be used in many very interesting ways...

I have no problem with language war trolls either, as long as they stay at 4chan, or where ever they come from...


When I first got back into the CPAN game last year, uploading my first module in years, it failed testing first off, and Andreas emailed me to tell me not only that it had failed, but why.

I'll give up Perl when I'm dead - and even then, CPAN will carry on my name unto eternity.


I don't know.. the article basically comes down to "i use perl because someone helped me at some point, when using it"... I don't think i would base such a decision on that..


I think the article was really about how useful the CPAN testing ecosystem was (and still is) to the author.

Someone (in the community) being helpful was just an added bonus :)


Offtopic question: this article links to http://everythingsysadmin.com/2011/01/python-is-better-than-... where author writes that google have official UI language. Anyone knows what is the name of that language? Is it something like XUL but for web?


Not sure what he's referring to. Might be Closure, which is compiler of javascript that compiles to javascript (just smaller & faster JS)

http://code.google.com/closure/compiler/


Probably Google's version of YUI, or Closure.


JavaScript?


This might be relevant, if you don't know what CPAN Testers is:

http://wiki.cpantesters.org/wiki/WhatIsCPANTesters

The best part is that there is a cool link from the pages at CPAN module pages to an overview of the results. Including of the modules used.

Here is the CPAN testers results for Moose, with results for all its dependencies:

http://deps.cpantesters.org/?module=Moose;perl=latest

(Note the links for every module, including a link back to CPAN. Btw, I like the D link, which shows what CPAN modules use Moose)


Thanks for that pointer. Without it I might have just guessed that you may well get guru-like test coverage and aid from other communities.


Why I didn't stick with Perl (although if you did that's OK with me):

- I discovered that a more modern language allowed me to do more with less, more elegantly

- Rails

- metaprogramming

- fun


Why I stuck with Perl (just some of my reasons!):

- I discovered more about the Perl language which allowed me to do more with less, more elegantly

- Moose

- metaprogramming

- fun (which is one thing Perl has always been IMHO).


Now you know you can't claim it does those things elegantly ;)


"elegantly" - def: pleasingly graceful and stylish in appearance or manner

I certainly find most of the Perl I write to be pleasing and stylish!

"troll" - def: a troll is someone who posts inflammatory, extraneous, or off-topic messages in an online community

Considering your account was created just seconds before you left your comment then i can claim at least this to be true :)


Why not? It's a matter of taste.


It truly is a matter of taste. The fact that you write something one way in Perl and a different way in Ruby mostly boils down to preference.

Metaprogramming in Perl? True metaprogramming?


Metaprogramming in Perl? True metaprogramming?

Yep. While it is generally easier todo in Ruby I find that you often hit limitations sooner than with Perl.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: