Reminiscent of Lazarus Long’s story of “The Tale of the Man Who Was Too Lazy to Fail” from Time Enough To Love, I recently stumbled into this quote:
Code you don’t write is the easiest and fastest to debut, test, document, read and support.
This quote to me outlines several principles.
First – while I strongly believe in learning by trying the hard, slow, painful way, by going through the basics, this doesn’t apply to when the priority is to actually produce. Also, the whole point of of doing it hard, slow, and from the basics is to gain an intuitive grasp of how to do it more efficiently, to improve the quality of your work, so that you get better at it, not to be a masochist.
This applies to code as to anything else. Brevity matters. As the quote attests, any line of code you don’t have to write is not only less time spent typing, but the time figuring out how to do it in fewer steps often pays itself back in better performance, and easier maintenance. Lastly, the next time a similar solution is needed, you don’t have to think about it anymore, and you still get the rest of the benefits.