---
title: "Beautiful Code"
date: 2007-10-09T23:59:02-04:00
url: https://blog.lmorchard.com/2007/10/09/beautiful-code/
author: Les Orchard
tags: [code, style, programming, poetry]
---

# Beautiful Code

<p><a href="http://michael-mccracken.net/wp/2007/10/09/the-editing-pass/">Michael McCracken</a>: "<i>Once you get a piece of code to the point where you believe it works - it's passing its tests - go back over it and edit it. That is, go back and edit it for clarity, flow, and style. Just as if it were an essay.</i>"</p>
<p>This is something I just don't hear enough of - code as writing, code as communication.  While I don't always make time to polish as much as I'd like, I'm always thinking about things like narrative and flow of a file of source code as well as the aesthetic shape and form of the code.  Code is fiction, code is poetry.</p>
<p>Compilation free of syntax and parse errors is baseline competence - and sometimes just good luck.  Apparent correct operation is not good enough: Moving on before the code has beauty is a poverty.  Ugly code kills motivation and comprehension - which attracts bugs and induces a downward spiral in morale.</p>
<p>Unit tests clear the way for courage and bravery; beauty yields living code worth fighting for.</p>
