Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
On Java...
DJBlufire
Unregistered

 
Post: #1
On Java...
This may sound silly, but I'm a little confused about the attraction of Java. I don't quite get all the hype it's been receiving; I don't think it's justified. I've used it not only from a user's standpoint but also from that of a programmer -- from both standpoints, I have not been very impressed in the least.

As a user, Java apps (LimeWire being a prime example) operated slow, were unstable, and had a GUI that was not only nonstandard but also was slow in responding.

As someone programming in Java (I used CW7), I found that the idea of easily writing portable code was very appealing. However, getting that code to work correctly was another story entirely, even when copying examples out of a book. Syntax errors were not as helpful as ones i'd encountered working with C/C++/ObjC, and runtime errors were ambiguous at best. Getting a simple console app to run correctly in Java was a matter of working several hours with my C++ teacher, who is a CS major.

So, my question is: what was I missing? Have my observations been random occurences? Were my difficulties working in a Java IDE the result of a lack of knowledge on my part? I would appreciate if someone from a programmer's standpoint could straighten the whole issue of Java out for me... Thanks! Smile
2002.09.15 01:11 AM
Quote this message in a reply
OneSadCookie Offline
Genius Bar
*****

Posts: 2,154
Joined: Feb 2005
Post: #2
On Java...
The idea of "write once, run anywhere" that Java was originally based on is something of a joke. Even more so once you consider GUIs, which don't feel native on any platform, even with the developer's best intentions...

Personally, I find GCC's error messages to be far more cryptic than javac's... but I guess you were using neither if you were using CW7 to compile.

At least Java gives you a runtime error message (usually including a stack trace) rather than simply crashing!

As with any language, there is a learning curve. I suspect that that's what bit you and your instructor, rather than that Java is a bad language. That said, I/O in Java (with java.io) was pretty icky last time I checked...

Java as a language to program in is very nice compared with other comparable languages. You've got an extensive class library at your fingertips (something that C++ lacks), you've got garbage collection (which neither C++ nor ObjC manage), you don't have a lot of the legacy of C (ie. no goto, pointers, &c), and you don't have a lot of the extra "ugly" features that C++ in particular added for no apparent reason (multiple inheritance, operator overloading, ...).

One nice thing about Java on Mac OS X is that you can program in Cocoa with it... in my experience the Cocoa API is much nicer than the standard Java one, particularly for GUI stuff. No, your program won't be portable -- but the interface will look and feel native.

GCC for platforms other than Mac OS X is capable of compiling Java to native code, eliminating most of the speed hit.

Just some random thoughts...
2002.09.15 01:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
DJBlufire
Unregistered

 
Post: #3
On Java...
Hmmm... thanks for the input, It's a lot clearer to me now. I can at least say that while I was writing the code, I did notice that the code was easy to write for someone with a background in C/C++ (which is... more than i can say for ObjC). I want to learn ObjC, but its been really awkward and difficult for me; on the other hand, i've had some really bad experiences with Java as I've told you.

All that said, which do YOU prefer: Java or ObjC?
2002.09.15 01:35 AM
Quote this message in a reply
OneSadCookie Offline
Genius Bar
*****

Posts: 2,154
Joined: Feb 2005
Post: #4
On Java...
For game programming, I prefer ObjC, since it's much easier to integrate fast low-level C functions (like 3D model renderers) with ObjC than it is with Java.

I also much prefer ObjC's syntax.

I would kill to get garbage collection, though Smile If I were writing an application (as opposed to a game), I'd be very tempted to use Cocoa Java.
2002.09.15 02:53 AM
Visit this user's website Find all posts by this user Quote this message in a reply
DJBlufire
Unregistered

 
Post: #5
On Java...
Thanks a bunch for the input! I'm gonna try continuing with learning Cocoa... it's been really awkward for someone with a background in mostly C/C++ console apps.
2002.09.15 03:08 AM
Quote this message in a reply
RedWolf
Unregistered

 
Post: #6
On Java...
Java 1.1 was a very poor performer and wasn't all that stable. Java 2 is a vast improvement in the stability arena, especially 1.3. Performance has been steadily improving and with the HotSpot technology in 1.3, you can get decent client performance in your Swing/AWT based apps. J2SE 1.4 supposedly has a overall 56% performance improvement over 1.3 but I haven't tried 1.4 yet to get a feel for how realistic that number is for real world apps.

The class libraries available for Java are getting to be pretty extensive. The core libraries are quite large and it can be overwhelming for new programmers to figure out. Even those who have been programming in the business world for a couple years can have trouble keeping up with the changes.

If you develop J2EE business applications that run on the server side, Java is very portable between platforms. I can develop large J2EE apps under windoze and simply copy the class files to HP-UX and my app works just fine. Can't do that with C: have to re-compile and usually you have a lot of conditional compilation logic to deal with.

Don't get me wrong, I still do a lot of programming in C and C++, although mainly on my Mac at home. C/C++ will remain a popular choice for many reasons but Java does have a lot of advantages/benefits over C/C++.
2002.09.15 04:14 AM
Quote this message in a reply
DJBlufire
Unregistered

 
Post: #7
On Java...
Hmmm... those are also very compelling reasons. I don't quite hate Java's guts anymore... well, I'm at least a better informed person now Smile

I think me and my teacher were using Java 1.2 or 1.3, but I don't know...
2002.09.15 03:24 PM
Quote this message in a reply
Deland
Unregistered

 
Post: #8
On Java...
Pardon my ignorance, but... what is a garbage collection?
2002.09.15 05:26 PM
Quote this message in a reply
DJBlufire
Unregistered

 
Post: #9
On Java...
As far as I can tell, its the automatic management of memory... so that you don't have to bother with "retain", "release", etc. as in Cocoa. Automatically deallocates stuff when you don't need it, I guess...

I suppose someone else could give a more technical/correct definition.. ;D
2002.09.15 05:33 PM
Quote this message in a reply
OneSadCookie Offline
Genius Bar
*****

Posts: 2,154
Joined: Feb 2005
Post: #10
On Java...
Garbage Collection is the automatic deallocation of dynamically-allocated memory when the run-time system detects that that memory is no longer referenced Wink.

Basically, it means no more free(), delete, -[release], &c... when you're done with the memory, the language figures that out for itself and cleans up.

It means no more memory leaks! (well, OK, not necessarily -- you could still make a linked list that grows without bound, for example -- but the most common case, not freeing memory when you're done with it, is completely eliminated).

Java is by no means the only language with garbage collection, most scripting languages have it, as do most (all?) functional and logic languages. Java was just the first mainstream language to push it Smile
2002.09.15 06:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)