Java Advocacy

davorg on 2002-01-18T09:39:17

So I decided to use some of my Copius Free Time to learn some more Java. I bought a copy of Core Java 2 Volume 1 - Fundamentals and sat down last night to read through the introductory chapters.

At the end of chapter one they have a list of "Common Misconceptions about Java". This contains things like "Java is an HTML extension" or "JavaScript is a simplified Java". One of them says "You should use Java instead of Perl for CGI scripting". Here's what they say about that:

This is half right. Not only should you no longer use Perl, you should also not use CGI scripts for server-side programming. Java servlets are a superior solution. Servlets execute much more efficiently than CGI scripts, and you can use Java - a real programming language - to implement them.

Now, I can understand them plugging servlets and I know that CGI really isn't very efficient, but that implication that Perl isn't a real programming language really rankled with me. It's so pointless. I almost gave up reading the book at that point.

I've emailed the authors to find out what constitutes a real programming language by their definition. I'll let you know if I get a reply.


Real programming languages

pdcawley on 2002-01-18T09:42:36

Scheme?
Perl 6?

Java Zealots

Matts on 2002-01-18T10:04:08

I went through the exact same thing with Elliot Harold, author of XML in a Nutshell. He's a big-wig Java author (author of Java I/O, and some other stuff), and takes every opportunity to dig at Perl.

The sad thing is the same people who take digs at Perl for not being a real language state quite emphatically that Python is a real language. Yet the differences between the two are small once you dig deeper than syntax.

Advocacy useless ?

arhuman on 2002-01-18T15:26:27

Sometimes I really get tired of this kind of sentences,
I can't count the number of time I heard some co-workers or (now ex ;-)friends tell things like that...
I tried to go into systematic advocacy :
  • JAVA is a REAL language, Perl is a "Script" language.
    Define what is a script language ?
    And prepare to have a lot of fun if they venture to the path : JAVA is compiled,
    JAVA use a system independant virtual machine (Replies=>same as opcode,more platforms available)
  • JAVA is a safer language thanks to type checking.
    Exists also in Perl via several modules, what about the taint mode, the Safe module ?
  • JAVA has a clean Object implementation.
    Perl has a very efficient one !
    Almost everything can be dynamic !
  • ...
But on the whole it was often just useless...
What really convince people is when you produce a robust application ten times faster than it was planned with JAVA,
what convince people is this "community feeling" that you find among Perl lovers...
Don't try to tell them that Perl is better, show them Perl is at least as good
(and I know you manage to do it well davorg...)


CGI

pudge on 2002-01-18T15:55:09

He also seems to say that Perl is only for CGI scripts.

A couple of years ago someone wrote an article comparing Java servlets to Perl CGIs, and talked about the language differences and the performance differences together, as if you can't have Perl servlets. It's either ignorance or slander, and neither is acceptable.

Funny You Should Mention That...

chaoticset on 2002-01-18T16:05:41

...but there was a similar discussion at the Monastery recently, mostly centering around algebraic definition.

Is that what people mean when they say that perl isn't really a programming language? Because it seems like explaining that we don't quite understand how electricity works, either. So what?

Sometimes when people feel inferior (say, because they watched another programming language beat the pants off of their favorite in something) they need to compensate. I couldn't care less; I'm learning more Java when I can. Tools, jobs, and all that.

I don't love Java, though. :\

People believe the first thing they learn

babbage on 2002-01-22T20:27:49

Back in November, I was working in a small development group in which I was working on a Perl/CGI/DBI system and another person was doing another system with Tomcat/JSP type stuff.

That Java developer was a biologist by training & experience, who had just started out on programming a year or two ago. She felt pretty strongly that for web programming, Java was unquestionably superior to Perl because, like your quote says, Java can do servlets while CGI scripts can't & are thus Perl is slower. It was pretty obvious that she was parroting something she read in a book like this one, and that she never heard of FastCGI or mod_perl or anything like that. And in the month I spent there, we never did manage to get Tomcat running on the big Sun Enterprise server, so she had to keep developing everything on her desktop while the CGI stuff I wrote worked locally and on the server, and should have run just fine under Apache::Registry if they ever installed mod_perl. What was that about scalability? :)

I think most people -- myself included -- are inclined to just go along with the first thing they learn, no matter how bone-headed it may seem to someone more knowledgeable in the field, and we aren't willing to put the time into going into more depth & straighten out these misconceptions. I can't see an easy way to change this. You can advocate for better Perl books, but that does little to someone hearing lies in a Java or Python text (or, to be fair, the unfair digs at Java in a Perl or Python book, or whatever). I can't see a clear way out of this situation in general...