I keep hearing very good things about the book Effective Java by Joshua Bloch
I'm new to Java and OO in general. Can anyone please tell me what exactly does this book teach and when is the right time to pickup this book.
I keep hearing very good things about the book Effective Java by Joshua Bloch
I'm new to Java and OO in general. Can anyone please tell me what exactly does this book teach and when is the right time to pickup this book.
It provides insights into how things should be done in Java to avoid common pitfalls. You should pick it up sooner than later - many of the issues addressed are not even specific to Java, but are valid in general.
This is somewhat subjective, so you may or may not get the response you're looking for.
I would put Effective Java into the category of "language utilization", not "language learning". That is - the idea is not to teach you the rudiments, and you won't find a hello world program in it. It won't show you how to make various things possible in Java, for the most part. Rather, it's to (1) expand your knowledge of the lesser-known features of the languages, and (2) discuss what "possible" things in the language are nonetheless bad ideas.
Some people would probably say it should not be a first Java book for this reason. I actually think it would be a good choice, though, provided that you learn the absolute basics from another source (online tutorials, or a class, or...), particularly considering that you're new to OO. It has a lot of code examples which can be helpful if you're inclined to learning that way.
To me, this book is not for beginners. You should read this book after a few years of practice.
If you already are a good java programmer, this book is a total worth read ! (I learnt a lot from it)
Mandatory http://java.sun.com/docs/books/effective/
Contains a sample chapter, reviews, table of contents etc.
Effective Java is a book that in a series of Items ( like lessons ) will teach you how to use the Java programming language ... well effectively.
It is a lot more useful when you already know ( or after reading it, think you knew ) Java, although the concepts may be applied for other programming languages ( C# for instance )
It is definitely not recommended for developers new to OOP, for it contains advice based on the premise you already know what are they talking about, for instance:
Item 16: Favor composition over inheritance
Basically tells you that inheritance presents "high-coupling" between your base class and your subclass with the inconvenience that know both classes are too closely related and they will be very difficult to modify. On the other hand, using composition give you more flexibility, and allows you at a given time to modify any of the classes.
Anyway, if you don't know already what is high-coupling, composition, inheritance, that single item won't be of any use.
And so on.
If you know Java already, this is a definitely must read.
If you can say to yourself,
"For whatever problem I need to solve (in Java), I can figure out how to do it now... I'm just not sure if I'm doing it the best way."
That's exactly when to dig into this book!
I disagree completely with the recommendation to wait a few years before reading this book. After you know the Java language basics and are ready to start writing real, complex programs this book is a must. Basically it is a set of best practices for using many common Java language features and API constructs. I view it as a basic literacy requirement in Java.
It is not the first book you read (unless you really have a solid programming background, but just don't know Java) because the concepts won't be meaningful, but it is the foundation of serious large project development in Java, most especially if your API's are going to be published or otherwise very hard to change.
Several items from Effective Java were excerpted in Dr. Dobb's Journal: "Creating and Destroying Java Objects: Part 1 and Part 2. These and the sample chapter on generics mentioned by Oscar Reyes persuaded me. If it's not your first book, it should be your second.