January 29th, 2002, 10:49 PM
Java more real then Perl?
I resent you implying that Perl (and to a lesser extent, PHP) are not powerful languages. Java is one of the slowest most antiquated 'modern' languages around and for data manipulation (can you say XML parsing?) Perl blows all over languages out of the water -- be that language compiled or interpreted.
January 30th, 2002, 03:44 AM
Re: Java more real then Perl?
I like Perl and Java equally.
But I'm confused about your comment. Putting aside the obvious fallacy that there is a one dimensional metric for a programming language, "power", I think you reveal your ignorance by firstly, "resenting" the proposition that Java is more powerful than Perl, and secondly, by confusing the notion of the speed of a given implementation for a particular task and the speed of a language itself.
Java means three things:
1. The Platform. It uses a virtual machine. It's not the only language to do so. In fact Microsoft, which push the idea that Java is slow and say this is because of the JVM are now adopting a JVM in their new platform. Several other languages can be used to compile java byte codes for the JVM (Definitely Python and I think Perl as well)
2. The programming language. The actual language of Java is where many of its strengths are.
3. The APIs.
Which is stronger, spider's web or steel? Well, at the same thickness, spider's web is. To me, Perl is like spider's web. You can write syntactically compact and accurate solutions up to a reasonable scale, there is a breadth to the language and there are excellent libraries.
But if you're writing very large applications, starting at several hundreds of kLOC, then to my mind, the strength of Java comes in. Now I'm not saying Java is always as fast as native code, but it's important to understand the concept of a large application here. If you are worried about small factors of time or space performance between one language and another, then your application is not big enough to justify entry into the comparison of programming languages. Programmer time is so many orders of magnitude more expensive than hardware that there is only one solution to small speed problems worth considering: if minor optimisation doesn't yield the required performance, buy faster hardware. It will be cheaper. Performance issues are not as important as they used to be because of this reason. Please note that if you're programming for enjoyment or doing a weekend hack, then this issue is irrelevant (as is "power").
Of course, I'm not trying to convince you of anything here. Perl is most enjoyable. But before you put PHP in the same camp, ask yourself: could you implement PHP itself (apache module or standalone server with interpreter etc.) entirely in PHP? I think not.
Just a thought.
January 30th, 2002, 10:24 AM
Re: Re: Java more real then Perl?
Wow, what a long reply ;p
The fact that Java runs on its JVM instantly limits its power and scalability. Java is just a favorite among corporate fools (i.e., managers) that don't know what they're talking about, but like to hear all these 'neat' things about such a magical language. A well-written C or C++ application can easily be cross-platform and would be so very much faster then Java.
My comment was aimed entirely at the line of "Real Programmers don't waste time with scripting languages" -- no, Real Programmers use C and C++ (or one of their protestors) -- NOT Java.
"But before you put PHP in the same camp, ask yourself: could you implement PHP itself (apache module or standalone server with interpreter etc.) entirely in PHP? "
Well PHP is a baby of a language; but its still a powerful-enough language, and because of its underlying C api, it can be optimized to out perform java (and I'm not sure that it doesn't already outperform jsp stuff).
One last thing: I'd like to point your attention to this little article:
That talks about the WayBack machine (http://www.archive.org/) and how perl is the key to controlling 100+ terabytes of data spread across 100's of servers and processing 200 requests per second. Don't talk to me about lack of scalability. I've never even hear of Java being used for anything slightly major, but perhaps I just havenít looked enough (granted, I havenít looked for it at all -- please feel free to prove me wrong on this).
Java is slow in any implementation (that I've ever heard of at least), therefore it is a slow language.
January 30th, 2002, 03:51 PM
Re: Re: Re: Java more real then Perl?
"A well-written C or C++ application"
Ah, but there's the rub. With much of what the Java API and language do, it is far easier to get a robust application than it its in C or C++ given how much memory management has to be done by the programmer, and the lack of standard libraries (beyond MFC) for much of what a modern application must provide. I can program an app on my linux box that has a very powerful GUI (from a programmers point of view -- swing's MVC approach for tables and trees may be slow compared to MFC, but in terms of power nothing else out there comes close), is network based, and uses XML as a data standard, and turn around and move that app to solaris and windows without changing a thing.
If i were to write it in C++, yeah, it would be fast, but it would take longer for me to fix memory leaks, would require a debugger to track down null pointers (which a Java exception dump tells me straight away, provided i don't have the JIT on; Windows without a debugger running only gives you the assembly and register dump which is useless), would require using a GUI library that's less powerful (making me do a lot more work by hand in terms of object->text translations and colors and stuff), and be stuck to one and only one platform because of incompatible network and gui APIs.
Java is power, and yes speed is sacrificed but I feel the speed isn't all THAT slow (its not like i'm writing real-time or a game or something).
As for "scaleability" -- its one thing for a simple perl app (or even a mid-sized one) to be fast when dealing with a lot of data -- underlying libraries written in the native are doing much of the work often in those instances. when he discusses scalability, its in the size of the program itself, not just the size of the data. Perl does not scale well when dealing with 100Klocs or larger programs...
And you can always take complex algorithms in Java and re-implement them in C and link using JNI, if a specific algorithm is a bottleneck...
Slow is relative. Fast is as well. Fast enough is all that matters. To my customers, Java is fast enough. When it isn't, then i'll take the experience of writing the program and use that to write a faster version in another language...but not 'til i've done all i can to optimize the java version first and see if i can fix the bottleneck they hit.
January 30th, 2002, 04:17 PM
Re: Re: Re: Re: Re:
I also dislike the "Real Programmers don't waste time with scripting languages" comment.
I think that C, C++, Perl, Ruby, PHP, and Java all have their place for different situations.
In defense of Java, Java is great for web services and the ablity to write once and run anywhere. Agreed PHP, is faster than Java on the web front, but Java is much less of a kluge than PHP. Watch for Sun's JDK 1.4 to grealy improve many different fuctions that Java is currently lacking.
As a side note Perl 6 will also have improved cross-plaform ability with it's own VM and suposedly it is tighly integrated with Java.
If you find any of this information incorrect let me know. Sorry for the kluge comment PHP developers.
January 30th, 2002, 06:06 PM
Java, Perl, Scalability.
Joe's reply really says it well.
But I will add the fact that code written in Java does not need to run in a JVM. I always use JVMs, but if you really need to you can compile Java code to native. (GNU's compiler can do this)
Also, Java does have problems. In my view there is a big problem with the type system.
The last thing I'll say on it is to emphasise a point made by Joe and myself.
What is scalability? What is performance?
In large scale projects, the most important factor is maintainability. The speed the program runs or how many bytes it deals with are irrelevant. In the cases where there is a performance problem, profiling allows you to only optimise what's too slow.
The amount of code you're dealing with plays a very important role in maintainability. the term "kLOC" means thousands of lines of code. If you've never heard of it then you're definitely not working on projects big enough to see the advantages of Java over C++. Perl is not inherently maintainable, Java is much more so. That's what I mean by scalable, and powerful for that matter.
By the way, the insistance on running speed as the sole measure of worth is exactly the argument made by assembler programmers against C and other compiled languages. As compiler technology improved, the benefit of not having to worry about registers and jump tables outweighed the diminishing advantage of manually written assembly over it's compiled rival. I expect the same thing with virtual machines. The performance of sun's JVM and the APIs has improved immensely over the past few years. My main machine for Java programming is a measly 400Mhz Pentium II.
If you like the Camel Book (like all good Perl Hackers) you may recall Larry's comments about optimisation. He says that there are lots of different kinds of optimisation. You can optimise for space (RAM), you can optimise for time (CPU), you can even optimise for obscurity (Obfuscation). I'm talking about optimising for maintainability. It's not glamourous but it is powerful.
January 30th, 2002, 09:20 PM
I almost wet my pants when I read "But you're a Real Programmer, and Real Programmers don't waste time with scripting languages. Nope, you need something a little more powerful, something with more horsepower under the hood. Something written in Java."
I was waiting for you to say C++, or maybe even .Net, but Java??! Heh..thanks for the laugh. I'd rather use scripting languages than Java...why slow a simple XML parsing task down with Java?
January 31st, 2002, 08:31 AM
Re: Re: Re: Java more real then Perl?
Well, FWIW, I have a host app that coordinates a pool of 8, 16, 32 modems, that runs unchanged on Windows, Linux and Solaris. I am very curios how your 'good design' in C++ could solve this problem.
No offence inteded, but I think you looked form 10 miles at Java. Running on JVM instantly limits scalability ? Native code is more scalable ? At least weird. Java not beeing used for something major ? Did you ever worked with a transaction monitor ? Did you tested an application server that conforms with J2EE standards, to see what is the meaning of scalability ? Several major financial institutions moving their legacy systems to J2EE means nothing ?
February 1st, 2002, 12:56 AM
Just a note to point out that the comment about "Real Programmers" was intended humourously (I actually know developers who think like that, and I'm sure you do too :), and in no way meant to disparage PHP/Perl/C/Java/XYZ programmers.
February 2nd, 2002, 08:48 AM
I for one agree with the comment, even if intended to be humorous. Until someone has exprience programming right down to the bare metal, perhaps a little research might be in order. To assist the "script kiddies', below are a couple references with which to begin your journey. Those who find some of the references obscure or arcane might do well to study these a little deeper.
February 2nd, 2002, 12:28 PM
XML Parsing With SAX and Xerces
I can't read the article because a dancing
ad box pops up and blocks the article when I
go to page 1.
February 6th, 2002, 10:45 AM
Re: Re: Re: Re: Java more real then Perl?
Do you know HOW MUCH does COST a J2EE ?
If you're a billionaire you may use Java.
I am an OpenSource adict so my entire life is dedicated to.
A real programmer should use whatever
is necesary for his business profit and
if he is pushed to learn new programming
languages that's what he should do.
My very opinion.
February 7th, 2002, 10:34 PM
Re: XML Parsing With SAX and Xerces
I tried to running the example code and keep getting this error message "MyFirstSaxApp.java": Error #: 454 : class saxproject.MyFirstSAXApp should be declared abstract; it does not define method processingInstruction(java.lang.String, java.lang.String) in interface org.xml.sax.ContentHandler at line 17, column 8
Using JBuilder5 with Tomcat 3.2 in Win2K. Java 1.3.1 and Xerces 1.4.4
February 8th, 2002, 08:27 AM
Re: Re: Re: Re: Re: Java more real then Perl?
In a word : you may find it for free ( JBoss, Tomcat, etc. ), or for 10K+ ( Bea Weblogic by example ). It is strictly your choice. The good thing is that conceptually it works the same.
February 22nd, 2002, 03:41 AM