This is a question for senior programmers:
What helped you get "good taste" in how you think and approach your code? By "good taste" I mean sensitive intuitions, fast and deep understanding of code, quick spotting of problems that might occur, informed tradeoffs, good command of base principles that apply to many tools/frameworks/libraries/languages.
What did it for you? Books? Training? Mentors? A team/project? ___?
Experience, time and trial/error are obvious answers; I'm looking for what made the difference for you.
I'm also curious if you think this skill can be taught or accelerated, other than osmosis from a mentor.