Effective Java
Introduction
Effective Java is a book very much in the style of Scott Myers' earlier C++ "Effective" series. The book contains 57 individual snippets of Java wisdom, broadly categorised into 10 sections including Classes and Interfaces, Exceptions, Threads and Serialisation. Scott Myers' books are classics; I was interested to see how this would compare.
The author, Joshua Bloch, has been involved in writing many industrial-strength Java libraries. His background is very much evident, in this, his first text. He consistently demonstrates the virtues of favouring libraries, clean APIs and advance design. I found the author very readable, and able to make a convincing argument, even in his more 'controversial' pieces. As with Scott Myers' books, there is a real-world, rather than purist approach taken to the language, with most of the code examples having a real-world feel to them. This is a breath of fresh air when lots of programming books tend to use more contrived examples.
The items
The author has endeavoured to keep the book accessible to less-experienced programmers throughout, while providing food for thought for the more advanced reader. For the most part this is succesful, but a small percentage of articles tend toward the simple side. Examples include 'Minimise the accessibility of classes and embers,' 'Write doc comments for all exposed API elements,' and 'Know and use the libraries.' We've all heard this advice many times and I don't feel that these add value. The vast majority however, are pitched at the right difficulty level. The selection of items is well balanced and broad, although unfortunately there are none pertinent to GUI programming.
Many of the articles are fundamentally based on known design patterns and idioms. Although a useful index to these patterns is included, I would have liked to see the virtues of design patterns summarised and demonstrated to a greater extent, perhaps in the introduction.
I was highly impressed with all code examples. Where used, they are consistently short, relevant and concise, with more verbose examples included on the website. The chosen code examples only ever assist in explaining complex concepts clearly.
The strongest area of the book for me was the section on threading. The author clearly demonstrates, for instance, how overuse of synchronised methods can lead to deadlock. He also provides food for thought on how the thread scheduler might trip us up. A section on moving from C constructs, which initially struck me as an odd category, proved very interesting and thorough. 'Replace enum constructs with classes' is a particularly interesting item, demonstrating the fragility of C enums, and indicating why the often-used replacement in Java (a bunch of public static constants) suffers from the same failings.
In conclusion
Ideally I would have liked to see some of the thinner items removed, and perhaps replaced with a section on the GUI libraries. I also liked the short prose sections, and thought the author could have spent more time setting out his stall before launching in to the items. Having said this, this is one of those rare books which could help a good programmer become an excellent one. Many of the books currently out there are aimed at either the beginner or the guru, and this book fills a gap.
I find this style of book very useful, in that I could foresee meeting the vast majority of the described situations at some point or another. So long as you aren't looking for tips to help you with your GUIs, this title is more than worth the investment.
For anyone interested, those sections in full:
- creating and destroying objects
- methods common to all objects
- classes and interfaces
- substitutes for C constructs
- methods
- general programming
- exceptions
- threads
- serialisation
You can purchase Effective Java from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
In a Windows dominated enviorment, is there any other better alternative to what I am already using? Does Java make sense?
The Little Giant
Military Intelligence
Advanced BASIC
Resident Alien
Found Missing
now comes Effective Java, another great title in the series by noted author Ox E. Moron
I don't need no instructions to know how to rock!!!!
thanks for submitting a rare thing: a good slashdot book review. timothy, if you want us to pay any attention to these reviews, you need to keep the quality more like this one.
Do not talk of this Java Sanctuary. There is no such thing.
equals three scoops of coffee per cup.
Hey when you are done slashdotting, check out the hot babes on Pajonet's hot or not contest!
It's just not a review without the Table of Contents! :)
J. Bloch wrote the collections framework. His code is clean... I mean, really clean. Given the author's credentials, I suspect this'll stand out in the vast ocean of Java lit...
Man, I'm barely done with Douglas Dunn's
Java Rules and now I gotta read this?
Actually, I'm glad to see more book son coding effectively as opposed to the dummy approach which is a sure way to Shoot yourself in the foot when the maintenance phase rolls around.
That said, one thing copiously missing from the review is whether or not the book covers J2EE at all -- which by and far requires some guidance in the developing the most effective Java applications.
--- have you healed your church website?
Have you actually used it lately? Speed has been the biggest improvement. Sure, it used to be slow as hell, I concur, but with Java 2 (1.4) it is wicked quick. And for windows apps, it's far better than VB in at least one aspect - grids. Java has a grid object that works the way you'd want it to, resizeable, sortable, column-rearrangeable... And for data drive apps, this is a major thorn out of my side.
How are you going to keep them down on the farm once they've seen Karl Hungus?
Never in 1,000 words or less.
The main things I hate about Java are its verbosity and its enforced and contrived structures. It deserves all the unwarranted complaints people made about Pascal and then some, because it's the ultimate B&D programming language.
But if that's how you get your kicks, gagged and bound with Sun sticking it to you, then so be it...
Intelligent Slashdot Moderations!
pb Reply or e-mail; don't vaguely moderate.
gotta love the astroturfers
java sucks, use language of the week.
linux sucks, use bsd of the week
everything sucks, use an apple product.
What grid object? JTable comes close to what you're talking about, but it isn't sortable by default. At any rate, you're right about the speed issue. The claim that Java is dog-slow is simply a myth.
Java is like running around the thornbush. It's less painful than rushing through it, but it goddamned slow!
er... Okay, so that was true for the old Java. However, there has been many years of constant improvement, refinement, etc on Java. It's getting better and better all the time, in performance, in reliability, and features.
Calling it goddamned slow is no longer correct at all. Nowadays if it's slow that usually means someone implemented their app in a slow fashion.
- David
Of course speed has been its biggest improvement; it couldn't get any slower! And for all the Java people bitch about standards-this and standards-that, every time they release a new version of Java, they break stuff. And then whenever I want a Java program installed, I have to figure out *which* JVM it wants! No more; fuck that shit. Get a STANDARD standard, like a goddamn ANSI standard, and don't try to feed me your Sun "standards-compliant" bullshit.
But the word we're objecting to here is "effective". Of course, slowness and incompatibility have to do with this, but the biggest problem with Java is bloat. Have you ever seen the source code to a small to medium-sized Java app? It could be a frickin' text editor, it doesn't matter, it has a source tree wider and deeper than the fucking Linux kernel. Compare this to 10-20 C files in the same directory for your average (fast, portable) text editor.
Of course, if you're building a GUI to connect to a database over a network, then feel free to use Java. Or Visual Basic. Or anything else that lets you clicky-clicky-drag components together. Because for that, speed doesn't matter, and you'll benefit from the extra layers of abstraction.
Just don't try to convince us that Java should be used for programming; Java is to programming what Mr. Potato Head is to plastic surgery.
... is the Java 2 Performance and Idiom Guide (ISBN:0130142603), by Craig Larman and Rhett Guthrie.
Yes, yes, well said. Unfortunately not many people will PAY ME to code in Smalltalk these days! Times are tough, man, and you still have to eat. Even if I did make an effort to learn a subpop language for career purposes, I'd ultimately have to spend lots of time justifying it and marketing it to employers and customers. Ok, granted, there would probably be fewer people competing for these jobs, but that's a risk that few are willing to take.
Java and C++ are popular because they're popular. Managers are often idiots, but most are smart enough to know that when you leave they'll have to find a replacement with your skills. There are lots of Java/C++ people out there, lots of books, lots of classes. Smalltalk, not so much...
And yes, I agree, BeOS and Betamax were better, but don't forget...there's a REAL WORLD out there!
This book is the best resource I've encountered for someone who knows the Java language, but wants to master its use. I can virtually guarantee that the rules and techniques covered in "Effective Java" will form the new foundation on which you will build the rest of your best practices for writing excellent Java code.
Written by the Joshua Bloch, the acknowledged expert on the subject, it is as authoritative as they come and extremely well-written. After six and a half years as a senior developer architecting and implementing algorithms and class libraries in Java, this book shocked me by summarizing much of what I knew about how to use the language effectively, while teaching me much that I did not know. It continues to top my recommended reading list for all new software developers at my company.
-dk
That's an optical illusion. You see, computers have been getting faster all the time. It was only a matter of time before people started mistaking this for an improvement in Java.
And for all the hand-holding the Java people do, you'd think they could spend some time explaining the godawful mess that the standard libraries are instead of spending their time crippling the language to have its own "special" notions of variable and function scope, reachability, and encapsulation that's much like other popular languages except far less useful, efficient, or straightforward.
But at least they're getting generics. Who knows, maybe one day they'll have closures. And then, in the far distant future, Sun can claim to have invented Lisp! No... wait... Lisp must be a Java rip-off! Yeah, that's it... And C, too, also a Java rip-off! JAVA, the first and best programming language!!
Man, this site is slow! Anybody would think it was made with Java .... just kidding .... I use Java all the time and I love it! It's great to see it improving all the time and being used for a whole host of different applications.
Go on, shoot some fish!
In most cases, it should be comparable to jdk1.2.
Java is slow? Maybe that's just your coding. These guys (among others) don't agree with you...
http://www.sosnoski.com/Java/Compare.htmlhttp://www.javagrande.org/jgsc98/index.html
IBM has achieved 90% the speed of C in Java. I personally use the CERN numerical libraries ... very cool, very fast. Java certainly can be fast. I've seen distributed Java beat C++ implementations hands down (that was hard to everyone to believe ... problem was C++ CORBA marshalling and the RTTI overhead in C++).
I've used Squeak, and have a background in coding Smalltalk (Digitalk, ParcPlace, IBM VA). Squeak is a great up-and-coming environment, but FAR from commercial. Can you name one commercial implementation in Squeak?
I think that lack of commercial viability makes Squeak impractical. Java, on the other hand, has scads of drop-in commercial libraries and components. This makes economic sense in business. Java also has a proven track record on the server side, and there are many, many successful commercial implementations in mission critical environments.
And NO, I don't think Java is the perfect enviroment; far from it. I've yet to see my ideal language, and I keep looking on the horizon for a dynamic functional/object/aspect language that performs and holds up in a commercial setting. In the meantime, I've got real work to do.
My main problem with reading Java code (besides the fact that there's so much of it, and it's scattered everywhere...) is that it doesn't indent properly. No large Java program will indent and fit comfortably in an 80x24 terminal, or for that matter, sometimes not even in 120x50. That's because Java programmers have no concept of line breaks, or how much should be put on a line.
s An d(you->use)->VerboseVariableNames(then, line(breaks,can->be))->Few(andFarBetween);
whenYouCan(keepReferencingYourObjects)->LikeThi
Of course this is a stylistic issue, but because the long names I mentioned are policy in Sun's own framework, it's impossible to totally get away from them. A preprocessor or macro system would help a lot here, but Sun doesn't have that either! That's too powerful and dangerous and useful to let the USER to have!
What are your reasons for preferring C++ (or even C#) over Java? Speed, standards-compliance, readability, lower memory usage, saner language constructs, not controlled by Sun?
There are a lot of Java books out there, but this is one that will help an intermediate-to-advanced Java developer. The code examples in here are concise, clean, and hard-hitting. The layout of the book allows you to pick it up and learn something if you have 10 minutes or 2 hours.
When I was first learning Java, I often had that nagging feeling that I was making things harder on myself than need be. This book cleared up a lot of those feelings, and helped get me on the right track for some of the great tools hidden away in the Java API. The API documentation is great for showing you what members and functions are available to an engineer, but this book shows you how to use the API. The review cites the author's avocation of knowing the libraries, I would contend that this book would help you get the most out of those libraries, and increase your understanding of them.
This book has become a must-have around my office, and if you are looking to get over-the-hump and move from an intermediate to advanced java software engineer, pick up this book. It is dense with information, and will save you a ton of time and energy. What more could you ask for from a book?
Effective Java is a book very much in the style of Scott Myers' earlier C++ "Effective" series
This is about the highest praise you can give a language-specific programming guide. In his books Scott not only listed many of the ways you could get in trouble in C++, but also gave clear explanations of why they were trouble and why his recommendations were good practices. His books are top of the list I recommend to people who know the language and want to write solid fast code. If Effective Java is as good, I'll soon be adding a copy to my bookshelf.
--Jim
What does 'setting out his stall' mean? I picture somebody settling on to the toilet and opening the newspaper, but in the context I don't think that's what you meant.
Thank you, a good review of an excellent book. I have maybe 10 java books, most of them from O'Reilly and none have been as beneficial to my development in Java as this one.
The code and the text are both very clear and concise, and you can read the book cover to cover, coming back later to study each advice more in depth.
I think you can get it from reading between the lines in the review, but just to make it clear to any curious beginner, this is not the first book you should buy if you are just starting to learn java. Use
The Java Tutorial instead, and maybe
Learning Java.
Being bitter is drinking poison and hoping someone else will die
What? Did I forget to include emoticons or tags? Did I not make the references to "Logan's Run" explicit enough? Sheesh. Flamebait.
This is a fantastic book, and anybody's who's serious about writing good Java code should study it carefully. It's one of the best-written books -- may the best -- on the practical details of programming that I've ever encountered, and the advice is gold. The section on correctly implementing equals() and hashCode() alone is almost worth the price of the book.
The reviewer complains about some of the thinner or more "obvious" items, but I disagree. Heaven only knows how many times I've wished that really good and experienced programmers follow what seems the obvious maxim: "Minimise the accessibility of classes and members."
It's true that "Know and use the libraries" seems rather obvious and vague advice, but Bloch's exposition drives home the fact that you may not follow this advice as well as you think. As always, his examples are excellent: he shows how an innocuous-seeming abuse of java.util.Random creates serious problems, and how proper use of the libraries fixes the problem. How often do you write a loop to print the contents of an array? I never realized until Bloch pointed it out that System.out.println(Arrays.asList(array)) accomplishes the same thing much more simply.
If you're a Java programmer, get this book. If you're a technical author, aspire to it.
Let me guess - you don't program much, do you?
Java is one of the most productive languages in the world. End of story.
Many important Java techniques and idioms are described so well in this book that I have been known to insert comments to the effect of:
(or some such) into my code. Most of the author's items should be as engrained in the mind of a Java developer as terms like 'singleton' and 'event listener'.
whenYouCan(keepReferencingYourObjects)->LikeThi
Actually, it should be:
whenYouCan(keepReferencingYourObjects).LikeThis
remember, no pointers... *wink, wink*
Anyways, I have yet to see anything that bad (I know you were making a point), nor have I seen anything similar that can't be fitted within 80 columns on 2 lines. You can't seriously tell me you have never seen a C/C++ line that long. You can always write horrible code no matter the language, blaming it on the language itself is just an excuse.
What are your reasons for preferring C++ (or even C#) over Java? Speed, standards-compliance, readability, lower memory usage, saner language constructs, not controlled by Sun?
Speed - used to be, IBM is doing some amazing things with their JIT compilers. I think someone else mentioned they were getting 90% of native code. So this is no longer an issue for me. I've even writing some fairly advanced 3D apps using GL4Java.
Standards-compliance - well... not sure what to say here. There's not ASCI Java if that's what you mean. Never been much of an issue for me.
Readability - as I have been arguing above, I prefer Java's... just me I guess?
Lower Memory Usage - For sure! Java's memory footprint is horrible. Price you pay for a virtual machine. I do hate this.
Saner Language Constructs - see Readability.
Not Controlled By Sun - someone has to control it, I'd say they are doing a decent job of maintaining the API. They also seem to do a fine job of listening to the needs of the users. I think sun does a fine job with the API itself, they need to improve their application of it (Sun's JVM pretty bad, etc).
My main reasons for preferring C++...
- lower level, like the control I think.
- Sun's Swing and AWT API's suck IMHO.
- Java is very large API, I get a bit overwhealmed at times.
----- "Blame the guy who doesn't speak English." -- Homer J. Simpson
Best of all, it's not 3 feet think like Effective Java Unleashed or The Effective Java Bible would be. You get lots of info with minimal fluff.
Washington, DC: It's like Hollywood for ugly people.
Shouldn't that be :
?Smart guys, those parser builders. Not to mention that if *that* is your problem, you can pay a little performance penalty and give names to all those intermediate objects.
"Oh, I hope he doesn't give us halyatchkies," said Heinrich.
Chapters
The authors include Hans Bergsten, William Crawford, Dave Czarnecki, Andy Deitsch, Robert Eckstein, William Grosso, Jason Hunter, Brett McLaughlin, Sasha, Nikolic, J. Steven Perry, George Reese, and Jack Shirazi.
This not a bad book. For $34(USD), there are some good learnings. This is one to have on the shelf.
www.cgisecurity.com/lib
Humm... I have seen benchmarks where Java (JIT'ed) is darn-near as fast as native code. Yes, benchmarks are like opinions...and you know what they say about thoes and people like yourself.
When this came out in 2001, James Gosling showed a copy of it at his keynote at JavaOne. They sold out every copy they had at the show, and the Effective Java talk later that day/week, was so packed you couldn't even get it. Great book.
I rarely find a tech book that offers more than a few examples I ear-mark. This book however has me re-reading it from time to time. The lessons picked up take time to sink in, and IMO no one can truly pick up all of the lessons on one read through.
Decent review of an excellent book.
I read books like other people eat hot dinners, and when I recommend Java books in work I only recommend this one. (I tend to find that a surprisingly number of coders only read one or two tech books a year anyway). "Effective java" is very well written; it's nice and short without sacrificing any exposition of the hairer parts of the language.
And as another poster has said, at work it's often sufficient to say in a review, "HashCode as per Bloch please"
If you read your own links, you would notice that even with the most contrived tests, Java still has frighteningly bad I/O performance that isn't "90% the speed of C in Java", but more like 25% the speed of C++ on a bad day... ...so expect to get many more positive moderations by your illiterate Java-loving friends...
It's nice to see a book review that actually reviews the book, rather than just regurgitating the table of contents.
"I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve."
Four sample chapters from the ten in the book are available in PDF format at the books website.
whenYouCan(keepReferencingYourObjects)->LikeThi
This code is a horrible violation of the
Law of Demeter. If you're doing this, formatting is not your biggest concern.
There is something about the idea of code examples being "hard-hitting" that made me laugh out loud.
Random is the New Order.
Effective Java is the best second book for learning to program well in Java. The best first book is Thinking in Java by Bruce Eckel, which is just out in its third edition.
p.s. To the many Java-haters on Slashdot: If you think Java sucks, fine. Don't read a Java book review. Don't post dumb comments like, "Hey d00dz, Java sucks!" If you have nothing better to do, try and post something usefull, like a review of the best PERL book you know. (Or C, Python, or BrainFuck, if that's your language of choice.)
-cbare
So sorry. My weird sense of humour strikes again.
It's awfully funny that your example, which was supposed to illustrate something bad about Java, is actually C++, and not legal Java. Even more ironic, the Java equivalent would be several characters shorter.
IBM has achieved 90% the speed of C in Java.
Bullshit. This is just FUD. Java has many
charms but 90% the speed of C is not one of them.
Try 25%. Maybe.
...that Effective Java talks about by using a static code analyzer. Like this one:
http://pmd.sf.net/
PMD will find places where you've used concrete collections rather than interfaces, left unused code lying around, etc., etc.
Tom
The Army reading list
Effective Java is the best second book for learning to program well in Java. The best first book is Thinking in Java by Bruce Eckel, which is just out in its third edition.
You forgot to mention that most of Bruce Eckel's books are available online in a variety of formats, for free.
Push the button Max!!!!
GridLayout or GridBagLayout layout managers for positioning components in the window.
hey, the comments in the parent post are actually
quite INCISIVE !!! As opposed to the
"jeepers, javas grate" type comments
in this thread that get scored +5 insightful.
I have always worked on the principle of one new thing per project wherever possible. New languages are a no-no, so when I speced out projects, we stuck with languages where there was a good level of in-house knowledge - and delivered on time. Java is mainstream now so it remains a good choice even though there are OO languages that may be better. It is well supported and comes with a good collection of objects.
See my journal, I write things there
In two words, dynamic compilation and inlining. You can do a lot more with dynamic information and dynamic performance profile. Being able to inline 50-100 nested calls in a hot spot may give you something the most sophisticated static compiler will never dream of.
(F.e. you can eliminate a virtual method call just because you dynamically know what method you are actually calling; you can inline methods from system and third party classes, etc.). Just don't forget to add -server to your java run.
I'm trying to write a Java chess app just for fun to see if I can do it and if Java is actually a limiting factor in the project. So far I'm very impressed with the Java performance. Definititely no show-stopper even in such a performance-critical field.
"...Sun doesn't have that either! That's too powerful and dangerous and useful to let the USER to have!"
"Java programmers have no concept of line breaks, or how much should be put on a line."
#1 You're an idiot.
#2 An opinion of Java programmers has no bearing in relation to the merits of the language. Your generalization about Java programmers is inane and irrelevant.
#3 Your example of bad Java code is actually bad C code, and bad code can be written in any language. This has no bearing on the merits of the language itself.
#4 Your implication that Sun holds back functionality because its too powerful or useful is stupid.
#5 The Java language is actually more compact than C++. The Java APIs are wordy and therefore explicit, and many people - myself included - think that is a good thing.
#6 Your entire argument amounts to a bunch of complaints backed up with hand waving, erroneous conclusions and anecdotal evidence. Don't bother raising a point if you can't support it.
#7 You're an idiot. Its worth saying twice.
I had been doing network admin work for a year and read this book as part of comming back up to speed.
Excellent book. Lots of information that is normally hard earned. At least it was the first time I learn all this.
you seem to be under the illusion that java exists only for web pages. you are wrong. Most java is not contained in web pages.
-------------------------
A person of moderate zeal
I know two Java books that are definitely worth their money:
- Effective Java
and
- Java Platform Performance by Steve Wilson and Jeff Kesselman
Of the second book there is a HTML version available at this link
Signature deleted by lameness filter.
This is the best computer book I have read in a very long time. It has changed the way I think about OO design and Java. I don't think I ever understood it until I read this book. Now I think I could apply many of the lessons from this book to writing good-quality C++. If you use Java, I highly recomend this book.
AWT/Swing are still too slow. Even with the latest release.
For reasonable GUI performance SWT is the way to go. The object model approximates AWT's so there's not a huge learning curve if you want to experiment.
Can you name one commercial implementation in Squeak?
Good point. However how many commericial applications are written in Java? I am not talking about custom client/server apps or installer programs but popular shrink wrap applications that are written in Java? Just curious as I never seem to encounter any and often wonder why not - given the Java advantage of cross-plateform capability.
If you're interested, you can get a free subscription to the print edition of Software Development Magazine. It's one of the few high quality freebees (and no, I am not affiliated with them). Also, as Scott Myers got mentioned here a few times: He writes for SD Magazine once in a while.
Under capitalism man exploits man. Under communism it's the other way around.
This is the best java book I have read. I swear I already knew 80% of what is in the book but I had forgotten half.
But the most useful thing about the book is that you can quote it to people. It has been a useful tool for applying to the Open Source mailing list I have to participate in.
And if you are writing an API in Java you need this book shipped to you overnight delivery. You can thank me later.
Read Epic the first RPG novel.
In that case, please tell me--why does Sun hold back powerful and useful functionality? I'm sure they have a really good reason, right?
:)
The C++ specification is incredibly verbose, and that's a good thing. Also, it hasn't changed *nearly* as much from version to version as has Java 1.0,1.1,1.2 (2.0?),1.3 (??), 1.4, etc., etc.
Also, I can support all of my points. And I have supported them, preciesely as much as you have supported yours. Idiot.
I'm not a big fan of Java, but I was impressed by everything that has been said here about how much Java has matured, so I figured I'd put it to the test.
I dug up some old benchmarks (the BYTEmarks, which includes a jBYTEmark, normalized to that same P90) that I can use to fairly compare Java and C performance.
I've got a 1.2Ghz Duron, and the C version of the BYTEmarks seems to reflect this accurately--with scores of 26.6 Integer and 21.4 FP, with a P90 being 1.00.
I'm comparing this against two separate Java implementations--Sun's JVM for Linux, and gcj (I also tried out a program that translates Java bytecodes to C, but the resultant executable didn't perform correctly). Here's a table of results:
C Bytemark: INT: 26.6 FP: 21.4
SUN (--server) INT: 4.21 FP: 1.80
GCJ INT: 3.63 FP: 1.71
SUN (Default) INT: 2.18 FP: 2.14
Now, I'm not surprised that the C version ran so fast, but I am surprised the the Java benchmarks did so badly, considering that both benchmarks were normalized to an index of 1.0 for the same Pentium 90! Maybe I got a bad copy of the jBytemarks--it was hard to find a copy at all--but it looks pretty legit.
Do any of you Java people have some amazing tips for me? I did use all the optimization flags I could find. Or is this typical performance for Java, making a 1.2Ghz Duron run as slow as a P200 or a K6/300?
pb Reply or e-mail; don't vaguely moderate.
Now that .Net's here, I don't see why people still bother writing on Java. Yes, Java was great back then in the old days, but it's quite dead now.
After doing a bit more research about JVMs, I installed IBM's JVM, which outperforms both GCJ and Sun here:
IBM INT: 5.8 FP: 6.4
These results still aren't as good as I'd hoped, but it does show that all of the JVMs aren't up to par yet, and therefore should be careful in choosing one!
pb Reply or e-mail; don't vaguely moderate.
Hahahaha ...
...
... the sites never work, so good. Try turning on your brains about once a week.
ah.
Hahahaha
uhm. Hahaha. This is really good. Sorry - Hahahaha
A portable text editor w/ standard features would probably only need 200 lines or so since most of the functionality is provieded from the API, the power of OOP.
...until my employer made me work with Java visionary and author Patrick Naughton. Now I don't want anything to do with it.
Best Buy can have you arrested
I don't think Java is programmer-hostile, or particularly verbose, although like all languages it can be a pain in the ass. I'll agree that most names in the JDK are descriptive, which comes at the cost of being long. It lacks certain shorthands I've seen in Python (yay built-in data structures and the slice operator!) and case-sensitivity does make for a lot of typo errors. And strong typing mixed with the Java primitive types is a headache. OK, I am now talking myself into your point.
I would like to see an example of a language that isn't programmer hostile, excruciatingly verbose, or a pain in the ass. MIPS assembly isn't verbose, but I have yet to see a language that did less work for you. Scheme has great elegance so long as your editor matches parentheses for you. Python I like, though whitespace as structure makes me a little uneasy when I think too hard on it. C and Perl I won't comment on because I left my asbestos underwear at the dry cleaners. ;-)
As everyone says, Effective Java is a good book. Bloch presents the pros and cons of his suggestions, to help you decide which ones are worth following.
You just have to keep in mind that your development project differs from the massively used JDK APIs that Bloch spent his time on. For example, changing public interfaces is much less of a problem when you're working on a self-contained project with a small team.
I am an infrequent Java programmer, but I found this book extremely useful when thinking about design in other languages. Much of the advice about how to fashion reusable libraries, how to think of the users of your class as potential wrong-doers is extremely useful.
It's all very well in practice, but it will never work in theory.
Firstly, a Java application written for Java 1.0 will still compile and run with Java 1.4. When the C++ standard (or the subset of the standard that any given compiler actually implements) changes people do not have any such guarantee.
Secondly, I'd be interested in knowing exactly what 'powerful and useful' functionality Sun is holding back?
This is a great book for those who know some about Java, and want to know more.
:-)
Also, if you ever get a chance to see Joshua speak, go for it! He's a really engaging speaker, much better than the rest of us nerds
So that is why my J2EE App Server only works about once a week. It is when you turn it on.
AWT was never slow. Swing is now quite fast with the 1.4 release. SWT is cool too, but harder to extend the functionality of compared to Swing.