Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh the memories. It's not very well written but most advices are sound if you're stuck in that very particular Java / C# hell.

The book "Effective Java" (from 2001) still has to one the "must read" for any Java programmer that didn't read it.

In it Joshua Bloch has always been very clear, from the start, about all the deeply ingrained ugly Java warts that Java had from the start (and still has). Like for example the complete and total utter impossibility to respect the equals() and hashcode() contracts in the face of inheritance.

Took a long time to set in but now quite some Java programmers are beginning to accept that having equals() and hashcode() at the top of an inheritable OO hierarchy may not have been the greatest thing since sliced bread.

The second book to read is Goets and al.'s "Java Concurrency in Practice" (one of the best looking programming book cover ever, which never hurts an incredibly high-quality content).

But the real lesson is that: Java is too complicated and has way too many warts to ever produce beautiful code. The JVM is not all bad but "Java the language" is really fugly.

Switch to a language that has a saner way to deal with concurrency (Say Clojure's STM or Go) and you can throw most of the pages in these books to the trash.



Can you go a little more into the problems with equals() and hashCode(), or link to something? I'm by no means a hardcore Java programmer, but I've used it for several projects, and these never stood out as particularly problematic to use and override, although I kind of see how they come across as kludgy in a whitetower kind of way.


"Like for example the complete and total utter impossibility to respect the equals() and hashcode() contracts in the face of inheritance."

But is that a problem with Java or is it a problem with ANY OO language?


One additional item I would suggest is Fowler's Refactoring. In java hell, the only viable weapon is a refactoring scalpel.


I highly recommend the second edition of Effective Java, which is more recent (2008) and covers Java SE 5 & 6.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: