Beautiful code

By Mathias Verraes
Published on 05 April 2011



Code doesn’t have to be beautiful. Some of the most successful projects have the ugliest code. Marketing, features, vendor lock-in, shiny GUI’s and all kinds of real or imagined qualities are what make or break a software product. Of all the factors that’ll make you reach your audience, beautiful code dangles somewhere at the bottom. The business value of beautiful code is near zero. CEO’s, managers, customers, and users, they don’t give a shit about the code. So neither should we. Just keep pumping out those LOC’s.

But we do care. All good programmers care about beautiful code. A well-crafted code base makes us happy to go to work every day. It makes us confident that anything they’ll throw at us, can be handled with grace.

And even if the code isn’t there yet, just having the opportunity to improve it gives us energy. Making all kinds of small, hardly visible changes, and over time seeing how all the wrinkles and hiccups disappear, is like watching natural evolution produce the perfect flower.

A last-minute change request from a customer is no problem for beautiful code. We welcome it as a chance to prove that the painstaking refactoring was worth it. We’re thrilled at how ridiculously easy it has become to respond to change.

The world is littered with garbage. So let’s pick up the trash in our own neighbourhood. Leave every piece of code behind a little cleaner than you found it. Beautiful code does make a difference.

Read next: Managed Technical Debt - July 21, 2013