We ramble about code, technology and life. Sometimes we actually code...


Keep it simple

by Kyluke McDougall on 11 August 2014

Don't get overwhelmed and overloaded with trying to add too much.

A function's #1 goal is to do one thing and to do it well. Once you go over that, you've got a useless function and are embarking on a journey that only leads deeper into the rabbit hole.

I've been sitting at my PC for the past few days, tirelessly coding away at my company's new website. I've had free reign over the design, the technology, the text and somewhat the images. This means, I of course went a little crazy at first and wanted to do everything without thinking about what it would do to my code (stuff the code right). Until I realised that a simple solution is often the better one. Not only am I not adding a ton of useless libraries and functions I'm never going to use, like importing the entire jquery script just to hide a div, what??? You probably think that's normal too.

But it isn't and it shouldn't be, because while you're creating fancy hover effects and adding confusing animations, a simple button click could've done the trick. It's not about taking away functionality, it's about optimising and finding the simplest solution to the problem.

So think about what you're adding next time and perhaps you'll find a lot of things you may be able to remove. I think you'll be surprised at how much functionality that actually adds to your project.

Sometimes this doesn't have to be a feature, just excess code to create said feature.

Anyway, happy coding!