insanelab.com insanelab.com

November 21, 2016 - Web development

Why the Quality of Your Code Matters

by Antoni Żółciak
More by this author

You can’t see what’s going on at the back-end, so why would the quality, cleanliness, and the overall feel of you code matter?

Let’s use a metaphor for this one

So, you bought yourself a car. A fancy one, an expensive one. It looks amazing. You enjoy everything about it, starting with picking up the keys from the desk. You love hearing the clicking sound when unlocking the doors. You enjoy sitting down and placing your hands on the wheel.

Then, you press the button. You hear the roar of your American V8 that’s ready for action and have absolutely no doubts about the beast that’s under the hood. It’s just as much about the looks, as it is about the speed, reliability, and people turning their heads. You know you’ll get far with this car. You’re sure that the Engine check light won’t turn on anytime soon.

Web development is the same

More and more people are designing their web presence well, but the code still sucks. And having the code kept clean is just as important as making the landing page pretty.

Coders are just like writers. You have to have a structure. An easy way of telling the story, even if the story itself is complicated. It’s your job to handle the complexity and ensure that it will all work together smoothly.

Coders are just like designers. You have to know what people might break to fix the problem before it even occurs. You need to ensure intuitivism all over the place for future bug hunting and adding new features. You’re here to make your next job (or someone else’s) easier and faster.

Finally, you’re here to make a million dollar design work as it should.

Coding is creating. Even if your creation comes from chaos, remember to document it well.

You (probably) work in a team

Chances are, you’re not working alone. Whether it’s an agency, a software house, or an entirely different kind of company, you probably have a team surrounding you.

And so, you need a code that’s both readable, maintainable, and upgradeable by other people. While developers sometimes prefer to rewrite the whole thing, you should pride yourself in building such a code that doesn’t require that.

Plural Insights has some more thoughts on that:

Since reading code is naturally challenging, if you write code that you’re barely able to follow as you write it, you’ll find you’re unable to comprehend it all later. Professional developers write so much code that after a few weeks of separation, most the structure and design decisions fall out of memory. It’s like looking at the project with a fresh perspective. Not being able to understand your own code a few weeks later can be a really depressing situation. Trust me, I’ve been there.

There’s a difference between laziness and technical debt

While technical debt can be used responsibly, laziness is not responsible at all. Having a temporary, lower quality code on your site is understandable – as long as you do provide additional feedback and make clear which part is to be upgraded in the future.

For code that matters, sustainability is essential. It’s the same for… I don’t know, name it. Construction sites. Would you like the guys who build your home, brick by brick, to be lazy? Or incompetent? We can all imagine the consequences.

There’s another phrase that we remind ourselves of from time to time. Imagine your successor as an impulsive killer. Would you like him to know who wrote the code before he took over if it’s not documented well enough?

The time you save when it comes to technical debt may be regained, as long as you’re honest with yourself and the team.

Honest.

Even about your laziness.

Takeways for you lazy bastards

  • Document your code.
  • Use technical dept wisely and responsibly.
  • Write small, maintainable and readable code pieces.
  • Don’t get lazy too often!

What is your challenge?

Tell us with any means provided. We'd love to hear from you!