"Beautiful Code: Leading Programmers Explain How They Think" is a book that attempts to to tackle this topic. "The authors think aloud as they work through their project's architecture, the tradeoffs made in its construction, and when it was important to break rules." The book has been sitting in my to-read stack forever. You might want to check it out.