Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jjohn (22)

jjohn
  (email not shown publicly)
http://taskboy.com/
AOL IM: taskboy3000 (Add Buddy, Send Message)

Perl hack/Linux buff/OSS junkie.

Journal of jjohn (22)

Tuesday February 12, 2002
09:18 AM

Perl v. Java

[ #2805 ]

From a truly ill-considered Ask Slashdot question came this pearl of wisdom. A former (award winning!) Java hacker confesses his adulterous thoughts for Our Favorite Language. I'd like to pick up on a few of his points and perhaps add a bit of my own.

  • Unicode: it's a sore spot of Perl, but seems to be hunky-dory for java. I lay the blame for Perl's developmental problems here on DWIM. As Perl coders, we've come to expect Perl to handle simple (and not so simple) string manipulation without that much handholding from us. I suspect that this bit of Sloth is biting the 'porters. Certainly, the unicode issue is preventing Perl from being a first class XML processing language (no XS cheating here).
  • Perl's threading system is still developing, but java's model seems to be working fine. Of course, Perl's forking model is probably better and easier to use than java's (cross-platform forking is difficult to guarentee). I say tit-for-tat on threading/forking here.
  • Dedicated IDEs are bullshit. There, I said it. Coders shouldn't handle their code with the tongs of an IDE, like some poor MS Word shlub. If the java folks have more IDEs than Perl People, good on 'em.
  • ALL PRAISE CPAN! Perl was years ahead of MOST other languages here and continues to put java to shame. CPAN is not only an FTP archive, it's damn protocol to download and install libraries! In your face, JAR!
  • Elegance is something for which python and java are praised and for which Perl is found wanting. Clearly, I don't get the 'elegance' argument and I never have. If 'elegance' means fewer characters typed during coding, Perl wins for most applications. Consider perl one-liners, the inclusion of perl hashes, regexes, etc. Perl delivers the promises of 'less typing'. Is elegence the lack of 'weird characters?' It may be, but Perl's syntax acts like a road sign to tell the maintain what's going on. Sigils (those funny characters preceding variable names) are not a misfeature -- they are essential to maintaining a Perl program. You always know what to expect from a variable with a sigil. Without them, the reader (and coder!) needs to find the original declaration of the variable to figure out what it is. I hate that. Is elegance the object model of a language? Python and Perl's object model isn't terribly different. Shocked? Don't be. The difference between python and Perl objects is that python has a object type, where perl blesses variable data. Java and Perl object models are very different. Java's single inherentence (which is a Good Thing) and object data protection (which is a Useless Thing) definitely come from the C++ crowd.
  • You always get the source code with every Perl script and library. This makes it simpler to debug programs in Perl because you can always step through almost all of the code, including the libraries.
  • Readability. Perhaps this is meant to go under 'elegance,' but I think this is a different issue. All languages can be obfuscated. It's not the language designer's perview to make you code clearly. Any claim a language makes to being inherently cleaner to code in (I'm looking at you, Java and python) is naive. I don't expect a java programmer to maintain a Perl program, just as I don't expect a Perl programmer to maintain a java program. In fact, that's why I'm not an editor for a Japanese magazine -- I have no facility for the language. Does that mean Japanese is inferior to English?
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Don't mention unicode around mr. jark. As one of the few porters left with a regular day job these days he spends his nights fighting with this rather sad state in perl. It has made some progress in the last year though so give the man some props :)

    • What I was postulating was that because Perl is so good with ASCII, people have the same expectation that it will be as good with unicode. We take for granted all the automagical string things that Perl does and I'm guessing this is what's making unicode so difficult to integrate into the language. If Perl merely said "there's a unicode module for making unicode objects which has index() and substr() methods," then Jarkko's life would be carefree indeed. Unfortunately, we Perl users want all our favorite Pe
      • None taken my sweet :) I just meant to imply that mr jark feels your pain as I can tell by the grimace on his face when he's working on Unicode or the engine that dare not speaketh its name.

  • I posted a comment on perlmonks [perlmonks.org] recently about this need for Perl people to put down Java, but a couple more things:

    Dedicated IDEs are bullshit. There, I said it. Coders shouldn't handle their code with the tongs of an IDE, like some poor MS Word shlub. If the java folks have more IDEs than Perl People, good on 'em.

    The thing missing from this statement is some sort of qualification, like "for me". I am more productive in xemacs and a CLI, but I'd never presume to tell someone else their tools are shit

    • As the self-appointed perl historian I always find it amusing when people ask how to make their own CPAN. All you have to do is read the packrats archive [perl.org] to see that there was little discussion about the matter and 2 guys who just put something together and did it. PAUSE is the killer app, CPAN is merely the distribution method :)

    • The problem is the Perl is ghettoized in programming community at large. If you read the original Slashdot thread, this will become very apparent. It is my belief that too many programmers have no real idea how their code and the bare-metal machine on which it runs work together. The whole notion of an application dedicated to programming is really a windows concept. In unix, the WHOLE operating system is the IDE. In Windows, user-end programming feels like an afterthought.

      Also here at use.perl, I know I'm

      • I hear you about Perl being ghettoized. But I've found that people who can put two clues together will be convinced when I quickly create something that works well and reliably. Or when someone asks, "Do you know if we can...?" and I immediately respond: "There's a module for that. I've used it. It's easy."

        People who aren't convinced by results aren't going to be convinced by anything, and they'll pass from fad to fad and eventually (in a perfect world?) seek their natural level. After a few strenuous tri