{"id":322,"date":"2015-08-05T12:32:50","date_gmt":"2015-08-05T12:32:50","guid":{"rendered":"http:\/\/www.scrummable.com\/?p=322"},"modified":"2017-06-06T13:05:34","modified_gmt":"2017-06-06T12:05:34","slug":"mnmlsm-simplify-simplify-some-more-then-start-simplifying","status":"publish","type":"post","link":"http:\/\/scrummable.com\/mnmlsm-simplify-simplify-some-more-then-start-simplifying\/","title":{"rendered":"MNMLSM: Simplify, simplify some more, then start simplifying"},"content":{"rendered":"

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<\/a>, paintings<\/a>, web design<\/a> can all implement (and benefit from) minimalism. So can code.<\/div>\n

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.<\/p>\n

Who wants a DRY KISS*?<\/h3>\n

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\u00a0consistency across the design.<\/p>\n

\n

“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”<\/p>\n<\/blockquote>\n

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!<\/p>\n

\"There<\/a>

There are unimaginable horrors lurking behind those wardrobe doors!<\/p><\/div><\/p>\n

It’s like CSS classes; you wouldn’t apply identical styles to two elements when you could assign the same class to them and only write one bit of CSS, so why do it with your PHP or JavaScript? I start by breaking a build down into independent functions. Then breaking those independent functions down into independent pieces of functionality. This allows me to reuse a function again and again. For example, on one site I built recently, we needed a Netflix<\/a>-style ‘bookshelf’ that scrolled sideways. This had to start on click of a button or swipe on a touch-screen. It also had to work on several ‘shelves’ independently of each other. By separating the function that made the shelf slide, I could call that one function on each shelf for each method of initiation. This made this one function simple to adjust, easy to replace if a better solution presented itself, and extensible for use on infinite shelves.<\/p>\n

\"Code,<\/a>

Code, like Dr Evil, is better when’s it’s Mini Me<\/p><\/div><\/p>\n

Andy Hunt<\/a> and Dave Thomas<\/a> 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.<\/p>\n

* D<\/strong>on’t R<\/strong>epeat Y<\/strong>ourself and K<\/strong>eep I<\/strong>t S<\/strong>imple S<\/strong>tupid<\/p>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":1,"featured_media":465,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,3],"tags":[],"_links":{"self":[{"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/posts\/322"}],"collection":[{"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":0,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/media\/465"}],"wp:attachment":[{"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scrummable.com\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}