Avoid writing code to begin with by leveraging existing tools, or build better tools so you don't have to write better code (and share with the rest of the world :).
Doesn't that lead you into a place where you can't modify the constraints of your application without sending the patches upstream (for example we hit limits with the mysql connector for C++ all the time, but they are our application specific).
Also, how do you mitigate another leftpad disaster?