Are you writing Clean Code?

Everyone one loves to solve problems and that is underlying joy of coding.

Though the code we write is delivering the outcome, is it been written in a clean way?

Are you proud enough for your code that you written?

Let us ask some questions ourselves…

Does the code you write is easy to restructure?

Does your code is easy to understand?

Does your code is not place of repetitive blocks of logic?

Does your code follow SOLID coding principles such as open close etc?

Do you maintain loose coupling and strong cohesion?

These are some of many mandatory checklists which SHOULD have YES as your answer in current techedge age.

With Agile and DevOps where the core principle is value addition, if any one of above question is No then we might not be adding value.

Many of these you might know already these principles and this might be repetition for you but its better to realign to clean code principles once again.

Ok, What is Clean Coding?

Clean code is the code where the tech debt is as minimal as possible that any developer can read and change easily.

Done with the definition. Ha!

How to do that? Oh, its not that simple as definition to write in one line.

To take a first pass on how to do..

These are some of principles of clean code but not limited to.

Ok, if we do all of these, then any developer can ready and change easily. But what is that tech debt?

Tech Debt is debt that you creating with in your code ( which you might have fixed but not doing so due to lack of time, release pressure etc) and paying higher cost tomorrow to refactor/fix these. For example the code is very tough to extend or complex enough to replace a part of the architecture, then there might be need of re-engineering project which is bit costly. So if we follow clean coding principle not only is easy for everyone but tech debt also comes to as minimal possible.

So, Clean Coding in these days is not going to be a choice but a practice that need to be adhered to make you world class developer.

Though I write this with Java in view, I believe these are universal principles across languages.

When you write a code, make sure your focus is on value and clean code than completion. Also if you are peer reviewer, then take each opportunity to bring these into the review discussions.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store