Pros: It runs on any platform including my thermostat and cell phone. It is object oriented - which needs a whole separate topic to define why THAT is the best way to go (extensibility and reusability etc.) It is free. It is easier to code than C++. It is less prone to bugs that C++. Cons: It has a (very slightly) lower performance than C++. Microsoft doesn't like it. (Or is that a Pro?)
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Aug 21, 2001
I can find many pros! But where are the cons? There's more to it than that. Come on
I came to Java from a MS/VB background, and the hardest thing for me to get used to was all the casting I needed to do.
For example, in Visual Basic, typing (not the kind on a keyboard) is much more loose. You can pull a value out of a collection-type object, and assign it to a typed variable, and the runtime will attempt the cast for you. Another example is recordset/ResultSet. In VB it's rs.get("columnName") and you don't need a getter for every single possible return type. (ie: getString, getInt, etc...)
In Java, you need to do more manual casting, which can mean a lot more typing (the kind on the keyboard), and hey.. sometimes there are multiply-cascaded calls and a single line of code can become quite gruelling with all the casts in there, and I always end up leaving off a ( or ) somewhere.
But I'm pretty sure there's no 'die-hard' reason this makes Java 'bad'.
The other issue that comes to mind when I think of Java is: SLOOOOW. Sorry Cindy, but there are times when Java is not 'slightly' slower. You just cannot beat using C++ (or even VB) for speed when we're talking about GUI'd apps. AWT is not too bad, but looks like a Win16 app. Swing looks pretty good (in fact I like the Metal look, and not the 'windows' look), but it is still a little buggy and is much slower than a comparable VB/C++ app.
Using Java for cgi or parsing/munging of files... VERY fast, as good as anything I think. But it still chugs on the GUI side.
Joined: Sep 29, 2000
Another Con is that if you need to do something lowlevel and operating system specific - you pretty much need to do it in C++ or whatever and use JNI to integrate it with your java app.
Mike, I understand your side of the VB GUI and yes Java maybe slower but when was the last time you created a GUI enviroment on anything other than Windows with VB. For that fact when have you been able to just ftp your compiled VB code over to any other system and run it. Not downing VB so do not take this as a crack on VB. I do agree that Java does run slower and since I have been using a little C# I have found that it runs faster than anything I have used. ------------------ Sun Certified Programmer on the Java 2 Platform