Last night this popped up on Twitter:
There should be a term for when you add a new feature with net negative lines of code. pic.twitter.com/yZB0uuq3H5— John Sheehan (@johnsheehan) April 7, 2016
Last year, as part of migrating our main web stack to AWS, we created a set of conventions for things like connection strings and API endpoint addresses across our various environments, and then updated all of our legacy systems to use these conventions instead of fragile per-environment configuration. This meant deleting quite a lot of code, and reviewing pull requests with a lot more red lines than green lines in them – I once reviewed a PR which removed 600 lines of code across fifteen different files, and added nothing. No new files, no new lines - no green at all – and yet that change made one of our most complicated applications completely environment-agnostic. It was absolutely delightful.
When I saw John's tweet, what instantly came to mind was a quote from Antoine de Saint-Exupéry:
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
So how about we adopt the term "Exupérian" for any change which improves something by making it smaller or simpler? The commit that removes 600 lines of unnecessary configuration. The copy-edit that turns fifteen thousand words of unstructured waffle into ten thousand words of focused, elegant writing. Maybe even that one weekend you spent going through all the clutter in your garage and finally getting rid of your unwanted lamps and old VHS tapes.
Saint-Exupéry was talking about designing aircraft, but I think the principle is equally applicable to software, to writing, to music, to architecture – in fact, to just about any creative process. I was submitting papers to a couple of conferences last week, and discovered that Øredev has a 1,000-character limit for session descriptions. Turns out my session descriptions all end up around 2,000-3,000 characters, and editing those down to 1,000 characters is really hard. But - it made them better. You look at every single word, you think 'does it still work if I remove this?', and it's surprising how often the answer is 'yes'.
Go on, give it a try. Do something #exuperian today. Edit that email before you send it. Remove those two classes that you're sure aren't used any more but you're scared to delete in case they break something. Throw out the dead batteries and expired coupons from your desk drawer. Remove a pointless feature nobody really wants.
Maybe you even have an EU cookie banner you can get rid of? :)