| Sign In/My Account | View Cart |
If you work with computers at all, you probably think of Java as a computing platform rather than as a coffee or an island in the Pacific. Java has generated tremendous buzz in its first five years of existence. Some of the excitement is genuine; some is just hype. But at the end of the day, you're probably wondering if you should learn Java. The answer is "Yes." I'll explain why.
When people talk about "learning Java," they usually mean learning the Java language and APIs. You probably won't ever have to know much about the JVM, although a basic familiarity with it is helpful.
Object Oriented ProgrammingObject oriented (OO) programming with languages like C++ or Java is widely accepted to be a step above procedural programming with languages like C or FORTRAN. The added power of OO programming comes at the price of the relative simplicity of procedural programming. There's a pretty steep learning curve involved with OO programming. If you already know an OO language, learning Java will simply be a matter of learning Java's syntax.If you don't understand OO programming, you'll have to begin the long journey to enlightenment. It took me about four years from when I first started playing with OO programming (in Objective-C, on NeXT) to when I really felt like I got it. My study was a little haphazard; you can probably cut that time to a number of months if you are taking a good course or immerse yourself in some good books. Don't neglect this step, however. It's not hard to learn Java's syntax, but writing decent OO code takes some serious work. |
There are technical and non-technical reasons for learning Java. I'll start by describing two code-level features, garbage collection and exceptions, that make Java cool. Then I'll talk about how Java is almost unavoidable in the programming world and the attractive price tag on Java tools and information.
No such thing happens in Java. Although you still request memory explicitly, the system recovers memory automatically using some magic called garbage collection. You lose some efficiency at runtime, but you'll probably never notice. Garbage collection cuts your development and debug time dramatically.
Java forces you to plan for the worst the first time you code. Java methods can throw exceptions, which basically signals the calling code that something has gone wrong. The trick is that you have to acknowledge the exceptions, even if you don't do anything about them. If you write code that opens a file, you have to write a handler for an exception in case anything bad happens. If you plan ahead a little, you can handle exceptions in a rational manner and end up with a program that gracefully handles trouble on your first writing.
It's also a good bet that many of your colleagues will know Java. It displaced C as the standard teaching language in universities sometime around 1997. As such, it is basically a lingua franca for computer programmers. It's probably worth learning Java even if the only benefit is being able to improve your communications with your peers.
Support for Java on MacOS 9 and earlier is still at the Java 1.1 stage. However, Apple's next-generation operating system, OS X, is based on a Unix core, which greatly simplifies the porting process. I don't know what Apple's official word is, but I saw Java 2 running on OS X developer release 3 back in March. I'm pretty confident that Java 2 will run on Linux, OS X, and Windows, which basically covers the entire known computing world.
Furthermore, the APIs are a vast treasure trove of working, reliable code that help you do all sorts of stuff. Want to use network sockets? It's in there. Want to connect to a SQL database? It's in there. Want to put a slick user interface on your application? It's in there. Want to digitally process images, or manipulate music files, or parse strings, or create digital signatures? It's all available. As a programmer, this will probably gladden your heart more than anything: Java's APIs are chock full of wheels that you won't ever have to invent yourself. This is really nice when compared with C++. You could spend all sorts of time learning somebody's C++ class libraries, like the Microsoft Foundation Classes, then start at the bottom of the learning curve again when you had to write an application for Linux. Once you learn the Java APIs, they work the same regardless of the underlying platform.
Finally, oodles of information about Java is available for free online. If you have Internet access and enough time, you can teach yourself OO programming, the Java language, and the Java APIs. Sun has a pretty good tutorial online and tons of API documentation. For a more focused approach, try a good book (say, for instance, Learning Java) or find someone to explain it to you. Bingo! You've just made your resume look a lot sweeter. Expect to be swamped with calls from recruiters.
O'Reilly & Associates recently released Learning Java.