tags:

views:

403

answers:

7

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.

+11  A: 

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.

gpampara
but it wont teach you the basics of java and probably not even how to program in java
willcodejavaforfood
Definitely pick it up sooner rather than later, but as important is to keep going back to it as you learn more.
Bedwyr Humphreys
+3  A: 

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.

Arkaaito
+8  A: 

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)

Jean-Philippe Caruana
I'd say it should be a few *years* of practice. This book will give you nothing if you don't understand the problems you might run into when you do it differently.
Stroboskop
@Stroboskop You're right : I wanted to say "a few years" but didn't want to scary @gameoverthanks for your comment
Jean-Philippe Caruana
Disagree about the "few years" part. I think it's worth reading as soon as you know the language, then re-reading once you've gotten some actual experience. Habits are much more easily made than broken.
CPerkins
That probably depends on how you tick. In my experience it's better to experiment, fail and learn from failures than to follow rules blindly.But i guess we can agree on that reading this book will make you a better programmer.
Stroboskop
+1  A: 

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.

OscarRyz
I think it's possible to infer the meaning of almost all object-oriented terminology from context (and, OK, maybe a few basic terms like inheritance).Whether or not I'm correct on that point, "highly coupled" is not an OO-specific term. Items like **Item 24: Eliminate unchecked warnings** are entirely unrelated to OO-ness (except perhaps that most common Java warnings are provoked by object abuse). I'm not arguing what I think is your main point (that it's not a beginner book), but I don't think a low level of OO knowledge/experience is a barrier. It's entirely to do with Java experience.
Arkaaito
@Arkaiaito: While "high coupling" is not a fundamental OO term, decoupling is: http://en.wikipedia.org/wiki/Object-oriented_programming#Fundamental_concepts_and_features But I get your point. It is hard to tell for me how hard would it be to read this book for a beginner. The 1st time I read it, I had 5yrs exp in Java already and I found it enlightening but I do remember the first time I had to differentiate between a class and an instance, took me a long, long while. So we agree, this book is for any developer, and will find it more useful, if you have Java and OO experience.
OscarRyz
+3  A: 

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!

Kevin Bourrillion
+1  A: 

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.

Yishai
+1  A: 

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.

trashgod