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.
closed as not constructive by Mark Trapp Dec 13 '11 at 20:24
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
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
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++.
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.
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.
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.
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"