Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been programming for a while and I think I write clean code. But I do this by hacking away, tinkering and testing things until I feel good about the functionality, and then coming in and refactoring, refactoring, refactoring.

I tend to write mostly in PHP, Java, and C. Are there any good books that will help me learn to visualize things better and not code everything as if in an infinite REPL loop?

Thanks.

share|improve this question

closed as not constructive by gnat, Walter, ChrisF Jul 18 '12 at 20:54

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.

6 Answers

up vote 1 down vote accepted

You can try Design of Design recommended by Joel

share|improve this answer
This is exactly the kind of answer I was hoping for. I'll check it out! :) – nc01 Dec 23 '10 at 7:50
1  
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Thomas Owens Jul 18 '12 at 12:01

Since you've stated in another comment that you're more interested in system architecture, perhaps you'll be more interested in Patterns of Enterprise Application Architecture by Martin Fowler.

However when it comes to coding I'll still recommend this book: Code Complete 2nd Edition by Steve McConnel

share|improve this answer
What sections cover this sort of thing? – nc01 Dec 23 '10 at 7:12
Not sure what exactly you need but the chapter-by-chapter descriptions in this page cc2e.com/Page.aspx?hid=131 will give you a clue. Chapter 6 offers insight on how to write classes, Chapter 7 on how to write methods Chapter 10-13 on how to properly use variables etc etc. It might look basic from this list but I've been programming 10 years when I read this book and I still learned something new! – Jon Limjap Dec 23 '10 at 7:18

The Pragmatic Programmer is excellent and highly readable. Might not get to the nitty-gritty that you want though.

share|improve this answer

On Java there are the Blueprints, like the Petstore. Beyond that there are tons of books on java architecture, including the excellent and free The J2EE Architects Handbook (from 2006, but most of it still applies well).

On PHP and C, while I don't know, I'd study some of the big frameworks, like Zend for PHP. Any big open source system written for your platform will help you understand architecture.

share|improve this answer

you'll want to be consistent, naming vars, functions etc.. this will stop you from going back and refactoring names.

You may also want to stay consistent with spaces, line breaks etc.. maybe keep vars 2 line breaks away or whatever you prefer.

reading code written by others will also give you hints as to what you find most readable or easy on the eye and you may want to borrow from their style. i have done this many times.

also, refactoring is not always bad, it shows you constantly want to improve your code. if you are refactoring too much it might indicate that you have not thought about how you are going to write something or solve a problem. and i would hope you are also improving interaction between methods and classes as well during this stage.

share|improve this answer

In my experience, when learning architecture nothing beats bugfixing/debugging applications someone else wrote and talking to other programmers. The best way to learn is to code and own a part of big application, and then expand your knowledge to include other parts of application.

share|improve this answer
1  
-1, the OP asked about books on software design. – Jas Jan 5 '11 at 6:23
Yes he did, however I'm not sure the problem OP is having is best solved by reading books so I'm suggesting the alternative. In my experience, books are helpful to iron out the kinks in your designs, and not so much when you're trying to design something from scratch. Designs I came across in books, even in those specifically about design, are usually rudimentary examples whose purpose is to make a point and move on. – Domchi Jan 15 '11 at 22:47

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