Does the new edition include any good new practical jokes? I've been hoping one of these editions will include your out-of-print Penguin practical jokes books, which I've never been able to obtain. Also, I'm still running Java 4; is there a lot of material that requires Java 5? And would you say that Java 5 is a big improvement over Java 4? Thanks,
Peter van der Linden
Joined: Sep 28, 2004
Great to hear from you. I should explain for the benefit of other forum readers that my first book was "The Official Handbook of Practical Jokes" which came out about 15 years ago. I was working for Sun Microsystems as a programmer in the compiler group at the time.
As a hobby, I was collecting practical jokes. After I had been collecting them for a few years, I noticed that I had a large number of really good ones. So to better organize the collection, I wrote them all down in a list, and kept refining it and adding to it, and before I knew it I had a complete manuscript. So I thought I might as well take it to an agent.
And then something happens that never, ever happens in the publishing world. The first agent I showed it to, liked it and took me on as a client. The first publisher he showed it to liked it and decided to publish it! Thus was launched a sideline of mine in writing! There was a second practical joke book a couple of years later. Then I branched into technical books (you should write about what you know) and never looked back.
The practical joke books are long since out of print. I put a couple of chapters of one of them on the CD for the 5th edition, but we dropped the CD from the sixth ed, so there is no practical way to get that text back in play alas, alas. Every now and again someone finds one at a garage sale, or emails me to complain about the fantastic price they are fetching in the used book market at http://bookfinder.com -- not a lot I can do about that, except grin ruefully and bear it.
A good sense of humor and a good attitude is very important to me. Programming is a lot of fun - I think most of us would do it even if we weren't paid for it (in fact, anyone who contributes to freeware or open source software proves that this is so, and I take my hat off to my colleagues who help out with Linux, or Java freeware). I try to put this sense of fun, and interest, and liveliness into my technical books, just as much as my humor books. It makes them easier for most readers - you finish a chapter, you get a fun Light Relief at the end of it.
But we're not here to talk about practical jokes! It's just a sideline of mine, and I am basically retired from that business now, so if you come over my house for pizza and beer sometime you don't have to be on your guard against exploding cans of nuts, whoppee cushions, confetti trapdoor zingers and the like. Or do you...?
To answer the JDK1.4 vs Java 5 question - well, Java 5 is the release with the most amount of change of any previous Java release. There have been two big, significant changes to the language (generic types and enum types) and numerous smaller but still significant changes.
Language changes always have a MUCH greater impact than library API additions. After all, you can ignore any new library until you are ready to use it. But you can easily come across code where you don't even recognize what the statements or expressions mean, now that the syntax of the language has changed. For example, you can now write in Java 5:
That tells the compiler that you are only going to store type String in this LinkedList object, and you will get an error message if you try and slip some other type in. The whole generic thing is aimed at doing more and better checking at compile time, while the program is under development.
Some people have missed the point of generics, and fussed about how all it does is let you avoid some casting. That is not the point of it at all. Anyway, the full story is in Just Java 6th Ed, when you are ready to extend your Java learning to get up-to-date with the current rev. of the language.
I always regret seeing more complexity come into Java. It took me a long time to get used to nested classes (which came in in 1997, Yikes!) I griped to John about my reservations - he is the Sun compiler engineer who designed and implemented it. He gently explained why I was wrong, and why I would have to get used to it so I did. But, well you know, you always think simpler would be better. John was a long time Lisp engineer, and he designed Java nested classes to be very close to a functional language feature called a "closure" with one eye on Lisp. Java is a more powerful language for it, and it all worked out OK in the end. If you look at what they did in the Microsoft world, they just introduced a total hack that said "ok, this method is a handler for that event"! Two different approaches, two different results.
Generic types are more complex than I would like - the syntax repels me (don't tell anyone I said that, OK?) - but I have to admit I cannot suggest any other syntax that would be an improvement. You could change the approach to use keywords instead of symbols. But that has some issues of its own. Anyway, bottom line: I think the saving grace of generics is that most programmers will encounter it as a CONSUMER of the feature, not a DESIGNER of some generic code. It is really only API designers who will define generic classes. The full story is in chapter 15 of Just Java.
That's a long answer, but as long as people are finding this useful, I will continue. Cheers,
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131482114/ref=jranch-20" target="_blank" rel="nofollow">Just Java(TM) 2 (6th Edition)</a>