As I move into my mid-40's, I am writing software I never dreamed possible 10 years ago, but the speed is much slower, sometimes a month will pass with only a couple lines of production code being written, then after a concept gels, everything comes together fairly quickly. I would have been fired long ago working for someone else at that speed.
Hacking culture and the crazy Wall Street valuations of technically indebted companies like Facebook have distorted where people see value in software, and what they consider a normal development cycle, but don't pay attention to that - envision perfect software and work every day to improve your skills, eventually you will close the gap and you will find yourself to be not mediocre any longer.
On a practical level, I gained a lot of productivity by learning Relax NG - formulating your data structures and relationships concretely before beginning to write code has saved innumerable wrong turns and helped avoid misunderstandings with my clients.