Surround Yourself With Good Examples

Friday 15 January 2016 at 08:00 GMT

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

Edgar W. Dijkstra, 18th June 1975

We could replace "BASIC" with the flavour of the month. A little while ago, it was PHP. For a while, it was Rails. I think last week it was Node.js. Next week it'll probably be Go. Regardless of the programming language or framework we're vilifying, there's an important lesson here: most people who were exposed to BASIC in the 1970s were learning from what Dijkstra considered to be the worst programming practices of the day. How could they possibly be rescued?

I think Dijkstra was being facetious. Of course you can unlearn; it's just much harder than learning the right way (whatever that is) to begin with. However, if you only have bad examples, you will write bad code. And I don't know about you, but I spent a lot of my time looking at code I consider pretty bad.

It stands to reason, then, that in order to write great software, we must offset the bad code with good code. How else can we continue to improve, rather than be dragged down into the muck? So, your homework: every day, read one piece of code you consider to be good. Your definition might vary: the code could be exemplary, impressive, intelligent, terse, expressive, or thought-provoking, but hunt it down, and don't stop until you find something.

We are not in a vacuum. The works of others impact us far more than many of us would like to believe. Don't fight it, embrace it: let them make you better.


If you enjoyed this post, you can subscribe to this blog using Atom.

Maybe you have something to say. You can email me or toot at me. I love feedback. I also love gigantic compliments, so please send those too.

Please feel free to share this on any and all good social networks.

This article is licensed under the Creative Commons Attribution 4.0 International Public License (CC-BY-4.0).