True (to a point), but read the statement again. I said the Java language was more platform-independent than the C/C++ languages. There are bugs in the standard Java libraries (e.g. AWT and Swing), but then again, most of the Java library source code is supplied to you (or can at least be downloaded from Javasoft). You can fix most of the bugs yourself.
However, the context of this article isn't about a language per se (i.e. without libraries), but about a cross-platform application development environment. Neither C nor Java is an environment without many libraries, as both are basically a syntax for pushing memory around. So the question isn't about the language, as you emphasis, but about the whole package, and so you have to consider the packages as well. The Java packages are, in my opinion, worse than the C packages, and more difficult to fix, if it's possible at all.
Also, I disagree with your statement that AWT and Swing have few cross-platform problems. Even in casual use, when I'm using Java in my browsers, I see tremendous differences between Netscape on linux, and IE on Window (for example). Sometimes, a java program is broken in different ways on the different platforms, which is a true nightmare to fix for a developer.
>If the library has a problem deleting files (this is an example I ran into), you cannot fix it...
Of course you can - just write your own code to delete files in a platform-specific way.
So you're writing C code again. That's my point -- if you're going to have to resort to non-Java solutions, why put Java in the mix to begin with? Surely, Java+C is worse than either alone! If you are writing a general-purpose application with lots of UI that has to go cross-platform, then Java is the right way to do it.
I would agree, if it weren't for the incompatibilities. As slow as Java may be, you are right in that it is being sped up, and besides, I'll admit that in all but 95% of most code, speed isn't an issue. All the GUI and main data handling can be slow as you please. The only speed-sensitive things I can think of are graphics functions (i.e. rotating, scaling), or some other kind of situation where you have millions of calculations to do, and where speed is important to the user. But I'd agree in a second that Java is best for most apps, or at least for 95% of the code in all apps, but for the incompatibilities.
In short, if Java did what Sun says Java does, I would drop C (except for the aforementioned fast stuff). But I just don't see that.
An example of this may lie in the fact that I cannot go down to CompUSA and buy a program written in Java. Why not? What is it about Java which prevents people from using it to create commercial-grade software?
The Java language is completely platform-independent. C and C++ have myriad platform- and compiler- specific dependencies. I have ported C and C++ code between platforms and compilers. There are a lot of gotchas. Java doesn't have this problem at all.
I'm afraid I completely disagree with you. I have also developed extensively on cross-platform Java and C++ projects, and I've come to the opposite conclusion. The most important problem with Java bugs is this: if you have a "gotcha" in C/C++, you can fix it, because you can "do anything" with C/C++, in the sense that you have complete control over the code, the libraries, etc.. However, in Java you are limited by the bugs in the run-time libraries. If the library has a problem deleting files (this is an example I ran into), you cannot fix it, whereas in C you always can. I have assisted multiple parties with cross-platform Java development, where I have arrived in the middle of a project. All of them had to resort to platform-specific code, written in C/C++, and called from Java. They had to do this to get around issues of speed, and of platform-incompatibilities. They all told me that, given the chance, they would have just stuck to C/C++, but it was too late at that point in the process to switch. Don't let this happen to you!;-)
However, I don't mean to sound like Java is complete crap. I agree that, when it works, it is good, and perhaps better that C/C++. The problem is, it doesn't work.
C/C++ is faster and more platform-independant than Java, provided you are using good libraries.
Take a look at PTK (the Portable ToolKit). The libraries have a C interface, but also contain glue for full C++ integration. Most importantly, it supports all the standard operating system functionality (everything from file/network access to DLL's to database access to full-blown GUI development) on 13 platforms (including *nix, Windows, and the Macintosh) and 7 hardware architectures.
However, the context of this article isn't about a language per se (i.e. without libraries), but about a cross-platform application development environment. Neither C nor Java is an environment without many libraries, as both are basically a syntax for pushing memory around. So the question isn't about the language, as you emphasis, but about the whole package, and so you have to consider the packages as well. The Java packages are, in my opinion, worse than the C packages, and more difficult to fix, if it's possible at all.
Also, I disagree with your statement that AWT and Swing have few cross-platform problems. Even in casual use, when I'm using Java in my browsers, I see tremendous differences between Netscape on linux, and IE on Window (for example). Sometimes, a java program is broken in different ways on the different platforms, which is a true nightmare to fix for a developer.
>If the library has a problem deleting files (this is an example I ran into), you cannot fix it...
Of course you can - just write your own code to delete files in a platform-specific way.
So you're writing C code again. That's my point -- if you're going to have to resort to non-Java solutions, why put Java in the mix to begin with? Surely, Java+C is worse than either alone! If you are writing a general-purpose application with lots of UI that has to go cross-platform, then Java is the right way to do it.
I would agree, if it weren't for the incompatibilities. As slow as Java may be, you are right in that it is being sped up, and besides, I'll admit that in all but 95% of most code, speed isn't an issue. All the GUI and main data handling can be slow as you please. The only speed-sensitive things I can think of are graphics functions (i.e. rotating, scaling), or some other kind of situation where you have millions of calculations to do, and where speed is important to the user. But I'd agree in a second that Java is best for most apps, or at least for 95% of the code in all apps, but for the incompatibilities.
In short, if Java did what Sun says Java does, I would drop C (except for the aforementioned fast stuff). But I just don't see that.
An example of this may lie in the fact that I cannot go down to CompUSA and buy a program written in Java. Why not? What is it about Java which prevents people from using it to create commercial-grade software?
I'm afraid I completely disagree with you. I have also developed extensively on cross-platform Java and C++ projects, and I've come to the opposite conclusion. The most important problem with Java bugs is this: if you have a "gotcha" in C/C++, you can fix it, because you can "do anything" with C/C++, in the sense that you have complete control over the code, the libraries, etc.. However, in Java you are limited by the bugs in the run-time libraries. If the library has a problem deleting files (this is an example I ran into), you cannot fix it, whereas in C you always can. I have assisted multiple parties with cross-platform Java development, where I have arrived in the middle of a project. All of them had to resort to platform-specific code, written in C/C++, and called from Java. They had to do this to get around issues of speed, and of platform-incompatibilities. They all told me that, given the chance, they would have just stuck to C/C++, but it was too late at that point in the process to switch. Don't let this happen to you! ;-)
However, I don't mean to sound like Java is complete crap. I agree that, when it works, it is good, and perhaps better that C/C++. The problem is, it doesn't work.
Take a look at PTK (the Portable ToolKit). The libraries have a C interface, but also contain glue for full C++ integration. Most importantly, it supports all the standard operating system functionality (everything from file/network access to DLL's to database access to full-blown GUI development) on 13 platforms (including *nix, Windows, and the Macintosh) and 7 hardware architectures.