I'm a self taught programmer; I understand the foundations of programming and what classes are, but my code tends to be messy with class methods interacting with a half a dozen other classes, and my structure is terrible. If someone else were to look at my code, I don't think they would be able to understand what was going on.


Read, in order:

Code Complete Is the first book you should read. It's about programming well. Regardless of what other book(s) you choose, read this.

Head First Object Oriented Design
I like the "Head First" book series in general. I like how they teach. In fact the authors spend a few pages at the beginning explaining their teaching approach.

Head First Design Patterns

Note: If you need a book to learn a language, look for one from the "How to program" series by Deitel and Deitel. After 30 years of reading computer books I've found these to be very excellent teaching books. There are volumes on Java, C#, C++, and others. They are expensive as hell because they are so popular, so go with a used copy. I have 5 different editions on Java and one on C++.

|improve this answer|||||

Look into design patterns. These are tried-and-true methods to structure your code to solve commonly encountered problems. The more you become familiar with these, the more you'll train your eyes to seek out patterns and solve them elegantly. It'll also make describing your code easier in that you can use the name of the pattern to explain it.

The most classic authority on this is Design Patterns: Elements of Reusable Object-Oriented Software, often referred to as The Gang of Four, or simply Gamma. This book is pretty readable and a good reference to have in your bookcase.

A friendlier read, which may appeal to you even more if you're new to the concept of design patterns is Head First Design Patterns, which is a whimsical approach to learning these and it covers the most often encountered patterns. Another advantage to this source is that it also explains some concepts associated with good object oriented design.

|improve this answer|||||

Applying UML and Patterns by Craig Larman

An excellent tutorial on object-oriented analysis and design, highly recommended. POS system case study alone makes it worth reading the book.

  • Another thing I like in this book is nicely described and explained walkthrough of a reasonably productive iterative development process.

Title reference to "UML and Patterns" is rather misleading, I think most of those who have read the book would agree on that. To study UML and design patterns one would better go elsewhere.

Book subtitle is much better fit for contents: "An Introduction to Object-Oriented Analysis and Design and Iterative Development"

|improve this answer|||||

Head First Design Patterns is pretty good. The Gang of Four patterns book is the canonical reference, but for a beginner, it's a bit short on the details of the whys and wherefores. Head First walks a less experienced programmer through examples and explains the thinking behind the design and the patterns. It's not comprehensive, but it's more explanatory, and even aside from learning the specific patterns, it's useful for looking at the thinking behind OOP design in general.

|improve this answer|||||
  • I see that Head First also has an OOP Analysis and Design book. I haven't read it, so I can't tell you if it is any good, but in general I've liked the Head First approach. – kylben Oct 14 '11 at 3:16
  • Now that I think of it, I learned a lot about design from Fowler's "Refactoring". Again, a lot of that is by implication rather than specific techniques for how to do design, but sometimes seeing something applied works better than just having it explained. It does for me, anyway. – kylben Oct 14 '11 at 3:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.