What the X-Files Taught Us about Real Aliens

by chromatic

I'm glad to see that TPF's public relations group has spread the Perl 5.10 press release far and wide, and it's getting some coverage. However, some of that coverage reminds me why I don't watch television news and why I treat the newspaper as entertainment and not information. Consider eWeek's First Release of Perl in Five Years Arrives:

Perl is a dynamic scripting language widely used in everything from Linux system utilities to Web servers to full-blown graphical enterprise applications.

What's a "dynamic scripting language"? Is there such thing as a non-dynamic scripting language? (No one seems to know what a scripting language is anyway.) Minor nit.

During its 20-year history, it gained massive popularity by assimilating the syntax from many predecessors, making it really easy to use for anyone already versed in sed, awk, grep, csh, C/C++, Lisp, and so on.

Syntax, maybe (but Lisp? Really?). Features, sure. Easy to use? That's debatable. Easy to start to learn, yes. I don't know that anyone will suggest that Perl is easy to master, though I'm happy to argue that its learning curve is gentle if long.

... languages like python with rigid syntax structure have arguably gained ground in recent times over perl, for applications that are developed collaboratively.

"Arguably" is a weasel word, so you can throw out this whole sentence. I'm not aware of any statistics that show that Python is more popular than Perl. (Arguably, the Maginot Line gained a lot of ground in the southward direction. There. Now Python fans and the French can berate me in the comments.)

Additionally, scripting languages specially-made for use on the Web, like PHP and Ruby, have eroded some of perl's once formidable share of the dynamic Web server scripting scene.

There's that "dynamic scripting" mess again. What does that mean? What's static Web server scripting anyway, and why would you need a programming language for that?

My favorite part however isn't about Perl at all. Did you catch that? Apparently Matz was really busy in 1993 writing Ruby not as a general purpose language but specifically to use on the nascent Web. How prescient.

If a journalist can rephrase a press release and make this many errors in five paragraphs in a subject I know something about, how many errors are there in subjects I don't know as well?

Oh, and the title comes from the last television news promo I ever watched, during the X-Files finale. The local Fox affiliate played a blurb for the evening news where the newsbimbo said, and I am not making this up, "Now that the X-Files is ending, let's see what the series taught us about real aliens. Stay tuned at 10."


Andy Lester
2007-12-31 08:30:17
The "dynamic scripting language" came from the phone conversation I had with the article's author. (At least I think it was this article.) He was annoyed that I mailed it to him just before a two-week vacation, and he wanted to get it published, so called me up to ask about the points he didn't understand, which were most of them.

He said "Perl's a scripting language, right? Used for websites?" and I said "We prefer to say dynamic language, and Perl is used for far more than the web. We used in everything from financial analysis to bioinformatics." He wasn't a programmer, so please imagine my trying to explain the defined-or operator.

So what DID the X-Files teach us about real aliens?

Noah Gift
2007-12-31 15:20:28
"… languages like python with rigid syntax structure have arguably gained ground in recent times over perl, for applications that are developed collaboratively."

umm... duh? Go ask any animation Pipeline in the world why they are switching to Python.

“Arguably” is a weasel word, so you can throw out this whole sentence. I’m not aware of any statistics that show that Python is more popular than Perl. (Arguably, the Maginot Line gained a lot of ground in the southward direction. There. Now Python fans and the French can berate me in the comments.)

Not to start a flame war war, but I don't think I can recall if I have heard of anyone saying, "I started with Ruby, or I started with Python, and it was unreadable so I switched to Perl."

2007-12-31 15:26:55
@Noah, I'm sure you know better than I do, but I had the impression that the ease of embedding Python over Perl made a huge difference to tool vendors as well.

(I won't discount syntax; Tcl and Lua are probably easier to embed than Python, and I find Python easier to read than Tcl for the most part.)

Still, I've never heard anyone say "I started with Chinese or Japanese but found it too hard to read so I switched to English." What could be easier than 26 letters and some punctuation?

Noah Gift
2007-12-31 15:44:47
Chromatic/The way it has been explained to me by many facilities, is that code readability gets to be a severe problem in Animation due to time constraints. Python forces a style that encourages readability. So in that case, yes, massive multi-billion dollar companies are switching wholesale to Python for readability concerns. Ruby also has a nice syntax, but the maturity of Python coupled with the tremendous Standard Library makes it a better choice for systems programming like animation pipelines. Python only gets readability problems when there is an overuse of inheritance, but that applies to any Object Oriented language.

On the switching subject, it does appear, that everything I read points to Perl people leaving Perl and switching to Python or Ruby because of concerns over readability. Maybe Perl 6 changes a lot of this, but that has been my impression.

2007-12-31 17:24:02
@Noah, I believe we've had this discussion before. I freely admit that Perl's dereferencing syntax is Very Much a Language Wart, but aside from people who just cannot deal with sigils, what part of Python forces people to write maintainable code where they could not do the same in Perl?

I find that choice of algorithm, use of meaningful identifiers, and careful factoring have so much more to do with maintainability than, say, indentation. If that's the case, and assuming you have programmers who know the language sufficiently that you feel comfortable paying them to write and maintain code upon which your business depends, what features beyond a lack of sigils and enforced indentation does Python have that other languages do not?

Drew McCormack
2007-12-31 17:25:08
"I’m not aware of any statistics that show that Python is more popular than Perl."

Well, Google Trends paints an interesting picture (see here): if it is to believed, searches for 'perl programming' dropped below 'python programming' sometime in 2006, and are now around 1/3 less. 'ruby programming' is on a par with perl, but seems to be declining at a slower rate. So the original article wasn't far from the mark.

Noah Gift
2007-12-31 18:07:52
Chromatic/As much as I wish I told all the major Animation Studios in the world what they should do, they could care less what I think :) I just talked to one of the "big boys" about a month ago, and they told me verbatim, the whole company is switching to Python, as their Perl Pipeline did not produce the same quality as comparable Python code due to readability problems. Don't kill the messenger, I am just repeating what they told me.

As trivial as it sounds a few things make Python more readable:
1. Culturally, in Python, it is a sin to write "fancy", "tricky", or "unreadable" code. Anyone that wants acceptance in the Python community must follow these rules, as stated clearly in PEP 20. People like to be accepted and liked, and as a result they respect the decisions of our leaders. Yes, I am a robot to my Python overlords. Their wish is my command...praise Guido!!! :)
2. Whitespace is significant improvement in language design.
3. Specific care has gone into designing the language as more readable at the sake of being more efficient or powerful. This was a design decision from day one. The design decision said, humans are more important that the computer, and reading code is more important than writing code.

Alternately, there are some incredibly clever Perl programmers who are immensely talented, but Perl culture of "there is more than one way to do it" leads to readability problems. Perhaps there is an elite crowd of Perl Monks who can read anything, but for mere mortals reading Perl is often more difficult than Python.

2007-12-31 18:28:14
@Noah, I'm sorry, but the TIMTOWTDI argument (which I think is the only substantive and specific one in your post) is complete hogwash, unless these poor folks at the animation studios find themselves having to maintain code written by the whole of Perl community in as many different styles as possible.

I've been programming a while, and I've never seen that that was necessary in any mainstream language.

I can buy that they already had significant Python expertise, or that the availability of Python extensions and plugins for existing animation software is a network effect multiplier. I don't believe that somehow Python's enforced indentation rules magically make all people follow all of the coding standards guidelines that improve the maintainability of software developed in groups.

If so, then someone, sometime, ought to be specific enough to explain exactly which features of Python make this so.

If that's not the case, then what I hear is that these groups didn't learn Perl or that they couldn't come up with sane coding standards. If the latter is true, they're in just as much trouble with Python as they would be with any other language, because the problem is not technical.

Noah Gift
2007-12-31 19:00:21
Chromatic/I think we are at that usual point where we have to agree to disagree. I think Python was designed to be, and is, the most readable programming language in existence, as a result Python is more readable than Perl. I don't have energy to past that point :)
Aaron Trevena
2008-01-01 03:35:45
All actual evidence is that the number of ruby and python programmers combined are a small fraction of the number of perl programmers.

How about jobs : http://www.jobstats.co.uk/jobstats.d/Details.d/Trends.d/SKILL/PYTHON.d/index.html
That looks to me like python job market is fluctating like the rest of the market - no growth at the expense of any other language - fluctating between 0.5 and 0.8 PERCENT - my god it's killing perl! not.

What about user groups? Conferences? 3rd Party Code ? Nope neither python nor ruby come close (it's not even worth mentioning the Ruby job market - besides being stalled at a fraction of python's just ask the author of mongrel about how great it is).

1, count them, Animation Studio has moved from perl to python, and not from the blog posts I read, for any technical reason - just a matter of updating legacy code and somebody wanting to use something else. Not exactly a sea change.

Oh and Noah, when you've worked on some major projects in a variety of languages, you'll soon learn that syntax and semantics really aren't an issue - it's all down to communication - whether at a technical or business level.

2008-01-02 12:43:44
Syntax, maybe (but Lisp? Really?).
I may be off base on this - customizing emacs is about the extent of my LISP experience. Perl does seem to owe some of its syntax to LISP, but I don't know if its a direct or indirect heritage. For example:

  • Functions accept and return lists by default

  • Lots of list processing in core like shift/unshift/push/pop/map/grep

  • Parentheses around function arguments may be dropped

  • Property lists seem to have the even/odd relation of keys/values in %h = @a

While the exact syntax and function names differ, the concepts are similar enough.
2008-01-03 00:43:45
Python, the Ada for Animation. I thought I escaped it 20 years ago, but apparently what's old is new again. ;-)
2008-01-03 09:45:58
@chromatic do you know japanese or chinese? I'd say there just about on par with english as to difficulty (at least japanese is, and I don't know any chinese, but it IS harder than japanese)

As to your comment that people don't switch to perl because their code is unreadable in another language. Sure this is true, but part of the reason perl is so powerful is becuase there are so many ways to do things (which consequently, can have a detrimental
effect on the readablility of code). You have to really work to learn to write readable perl, but once you do the job is sooooo much easier.

2008-01-03 11:48:32
@chromatic, I'm a perl addict, not frustrated, but rather realistic in perception (at least, I hope so). The press echoes a general perception, I guess. "dynamic scripting lang": Yes, why not? OK, it's a tautology, just emphasizing (round ball), but not a mess. Why are you "not aware of statistics"? Look at the "TIOBE Index" and others! Accurate statistics? who cares - just well-known/popular! Python to the OLPC, Phython to the SymbianOS, Python everywhere, that's hype, and it has strong impact in the minds of the public. Perl needs an image lifting ... and not "a fair technical comparison"!
2008-01-03 12:36:34
Well, I should throw a technical arg, too. What's about standard libraries? Java includes everything to build a GUI as part of the JDK, Python claims to have a feature-rich Stdlib, and Perl? You may install Tk before using Perl's interface, you may install CPAN modules (e.g. List::MoreUtils). NO, I want to have my slurp() and uniq() Just-In-Time (i.e. without copy/paste)! Damian's "Perl Best Practices" preaches about using "quasi-standard CPAN Modules" and is widely acknowledged for this approach. Where is any consolidation seen at this frontier?
2008-01-03 14:12:59
Apropos Aliens: I discovered them! (at least one)
Reading this article -> chromatic -> book "Perl Hacks" -> P5NCI.pm
Oh, my god! Here it is! The ease-of-use C-lib interface I looked for! 1000+1 thanks to chromatic! But once again: Is this the way it goes? Do I have to find "the alien" by chance? (in the Hacker's Guide?) No, it should go into the Standard Lib, because it's the one-and-only solution for just using a small but urgently demanded C function!
2008-01-03 21:52:44
>>dynamic scripting language
A language you can make do something without kicking it down the beach? And, more, one that has some ease.
Then again you make most things mean /something/.

*wanders off muttering about knowing nothing*

2008-01-07 04:59:27
Noah, you can "force" indentation in Perl with perltidy. It will fix not only indentation, but many more issues.