My first venture into OOP was Java. I took a class at a local community college and the instructor was a true geek, having more comfort interacting with a computer than with people, clearly not fit to teach. I learned nothing. It came with a book which followed the usual path: step by step creation of an applet, a few buttons and then turns you loose to create that next killer, multithreaded, JDBC-driven RMI Java app.
A stint of library books on outdated Java versions was fruitless and so I made the very poor decision to pay Sun $1,800 (CDN) for their Complete Java Technology Web Bundle
which I hoped would teach me everything I'd need to become certified. Don't get me wrong, it's a good source of information, but I didn't take the "bundle" keyword to task. (happy note: the boss paid for the course, but I nevertheless feel slighted)
So I've had to supplement a $1,800 course with books. A shame. But my misfortune will hopefully be your good fortune. I bought Head First Java after reading numerous reviews online and, with that, here's mine.
You will find Head First Java completely different from any other programming book you've read the moment you turn the first pages. It is laden with retro images, Leave It To Beaver-style clip-art with silly but relevant captions. The visual style intends to make use of the non-programming side of your brain to help remember concepts and, in my opinion, does much more by helping you stay focused and interested. We've all had those late nights trying to learn something and find yourself falling asleep no matter what you do. With some books that happens in the middle of a sunny day with loud music blaring through headphones, even if you're fully interested in learning the subject.
Where Head First Java succeeds is by keeping your attention, teaching by example and introducing key OO concepts by using simple, real-world examples. Its strength is two-fold: "simple, real-world" is obviously easier to identify with and most examples are a little (or sometimes very much) off-the-wall, which makes committing the concept to memory much easier. Though not quite to the implied extent, the difference is learning Java from Jim Carrey or learning Java from Ben Stein
Granted, some might not prefer this style. Some may even detest it. More than likely, those people would be of the hacker class that already know C, C++, SmallTalk, Assembler, Delphi and Fortran, and are simply looking for something to quickly show them Java's syntax so they can get a project done in a weekend. They should certainly stay away from this book, as it is most definitely not a reference book, nor an intermediate or advanced book. But if you're relatively new to programming and you are interested in Java, here's your book.
Each chapter builds nicely on the previous chapters and ends with some exercises and puzzles. The exercises are (in the authors' words) required content, whereas the puzzles are optional. The exercises are sometimes difficult but not because the content wasn't there to prepare you, but because they are right-brain questions for understanding left-brain content. (More info
) The puzzles don't necessarily reinforce the learned content but they help you think abstractly in Java, and many will take you some time to figure out.
Even though Iíve read the first few chapters of Java books, garnering the basic concepts of OOP, before this book I didnít fully understand much of it. And the beautiful thing of OOP is that, once you understand it, creating a solution using procedural (scripting-type) languages seems cumbersome and, surprisingly, abstract.
In my experience, learning a new programming or scripting language comes down to three things:
1. Understanding the methodology - in the case of PHP or other procedural scripting language, understanding how the script is run (parsed), how it interacts with databases and the webserver. In the case of Java, itís the initially confusing but ultimately rewarding concept of OOP.
2. Learning the syntax - which words do what, what order to place them to get the results the compiler (or parsing engine) requires.
3. Knowing where to go to find the answer (read: method, function, object, tag) you require - this is where you become a developer. Books and classes can teach you how to make calculators, bank account programs and online delicatessens, but when you need to build YOUR application, if you don't know what method or function you require how do you find it? If you don't know the name of the person you're looking up in the phonebook, how will you ever find them? What if you don't know how to use a phonebook? It's an extreme example, but understanding the Java API and how it is defined is the golden ticket.
In this book the concepts of OOP are clearly defined and explained in an entertaining and memorable way. Once you begin understanding those concepts, the Java API itself begins to look less ominous. Covering everything from objects to creating graphical user interfaces (GUI), exception (error) handling to networking (sockets) and multithreading, even packaging up your pile of classes into one installation file, this book is quite complete.
If you're hesitant to pick up this book, I definitely encourage you to finger through a copy at the book store or peek through the online sample pages
at O'Reilly's site, or get more info at the website
. That's the only way to really determine if you like the style. If you do, I'm certain you'll love the book and, like me, hope that the Head First series will expand to many other subjects!
1. Breaking the Surface: a quick tip
2. A Trip to Objectville: yes, there will be objects
3. Know Your Variables: primitives and references
4. How Objects Behave: object state affects method behaviour
5. Extra-Strength Methods: flow control, operations, and more
6. Using the Java Library: so you don't have to write it all yourself
7. Better Living in Objectville: planning for the future
8. Serious Polymorphism: exploiting abstract classes and interfaces
9. Life and Death of an Object: constructors and memory management
10. Numbers Matter: math, formatting, wrappers, and statics
11. Risky Behaviour: exception handling
12. A Very Graphic Story: intro to GUI, event handling, and inner classes
13. Work on Your Swing: layout managers and components
14. Saving Objects: serialization and I/O
15. Make a Connection: networking sockets and multithreading
16. Release Your Code: packaging and deployment
17. Distributed Computing: RMI with a dash of servlets, EJB, and Jini
A. Appendix A: Final code kitchen
B. Appendix B: Top Ten Things that didn't make it into the rest of the book