MNMLSM: Simplify, simplify some more, then start simplifying
Minimalism is an interesting thing – far from meaning as stark as possible, minimalism is the idea of removing anything unnecessary for base level functionality. Imagine a human face. Now remove all of the details you can until it still resembles a human face. If, for example, you took the eyes out and it looks wrong, stick them back in. Once you’ve finished you have minimalism. Buildings, paintings, web design can all implement (and benefit from) minimalism. So can code.
When I started coding for a living I had no idea about loops. The last year of solidly building WordPress sites has taught me a lot. I still start my code the same way I used to code though. I write everything out longhand, then work out the commonalities and parse them as variables, arrays, and loops. Then I start cutting out the duplicated code. Once I have this, I can start working out what I can cut from where to make my code as small and as simple as possible.
Who wants a DRY KISS*?
Every single developer! The reuse of code improves performance, makes updating easier – especially if the project gets passed to someone else when you’re inevitably hit by that bus that everyone goes on about, and benefits consistency across the design.
“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”
Everyone knows that deadlines get in the way of perfection and sometimes it’s necessary to chuck something in that works rather than delay everything to produce code that will make other developers moist. This is where Technical Debt comes in. Set aside some time after deployment to tidy up your code. Think of it like throwing all of the stuff from your floor into a wardrobe when your mum visits. Your flat will pass muster for the duration of her visit but, if you don’t go and sort that wardrobe out once she’s gone, you’ll be in for a world of pain later on!
Andy Hunt and Dave Thomas originally intended their principle for use in software engineering but it is sound practice for almost all aspects of development. Keeping your code clean, reusable, and – above all – simple, makes for better code and, by extension, better websites.
* Don’t Repeat Yourself and Keep It Simple Stupid
Real. Simple. Syndication.
Get my latest content in your favorite RSS reader.
I use InoReader but you don't have to.
In almost all cases, the comments section is a vile cesspool of Reply Guys, racists, and bots.
I don't want to have to deal with that kind of hell so I don't have a comments section.
If you want to continue the conversation, you can always hit me up on Mastodon (which is not a vile cesspool of Reply Guys, racists, and bots).