HOW TO CARE FOR CODES

Are you ready to take your code from good to better and from better to best?

Let me start with three fundamental questions

1. What are you are writing as a developer?

2. Is it good?

3. Is it readable?

This article is to present ways to improve your code pattern and to improve your coding sense.

Have you ever been significantly impeded by bad codes? if you are programmer of any experience then you’ve felt this impediment many times, its simply called wading. We wade through bad code, we slog through a morass of tangled bramble and hidden pitfalls. we struggle to find our way, hoping for some hint of what is going on.

Why do write bad codes?

Perhaps you felt that you didn’t have much time because of the backlogs; that your boss would be angry with you if don’t finish the feature in time; perhaps you are just tired of working on this program and you wanted it to be over ; that you have promised to get done and realize that you needed to slam two or more modules together so you could move on to next one, we’ve all done one of the above, but the only way to make and meet up with deadline and only way to get fast- is to keep the code as clean as possible at all time.

Programmers typically imagine they are writing good and clean codes if they simply adopt a design pattern, but of course in reality that is not enough. Even if you adopt the SOLID principle without certain measures your codes won’t be as solid as a brick wall or a vessel containing pebbles

Frankly speaking no good and clean code without a design pattern consciously or unconsciously.

I know you are one of those programmers who intentionally and unintentionally wrote bad codes, then had to put in great effort for code review or even feel so embarrassed reviewing codes writing by you.

You can use the points below to check whether or not you are writing bad codes

· Does the code implement a design pattern?

· Is the code tightly coupled?

· Is the code testable?

· Is the code human readable?

· Is the code duplicated?

· Is the code too lengthy to be understand?

· Are methods performing more than one question?

Perhaps you can add more checklist that suit your own experience, but whenever I analyse my code using the above points i am able to discern whether or not my code is dirty or clean.

HOW TO CARE FOR CODE

A clean code should:

1. Run all test

2. Contain no duplicate

3. Express all the design idea that are in the system

4. Minimize the number of entities such as classes, methods etc.

5. Use tiny abstraction

6. Use good, intention revealing variable names

7. Make sure your function is shorter

8. Make sure your function does just only one thing

9. Avoid flag arguments

10. One level of abstraction

11. Make sure your function should either do something or answer something

12. Don’t repeat yourself

13. Explain yourself in codes and avoid too much deadly and unnecessary comments

14. Use exceptions rather throw codes

15. Don’t return null

16. Keep test clean

Clean code with the above features are written by programmers that cares about their codes, clients and their environments

DO YOU CARE ABOUT YOU CODES?

To learn more on how to improve code, read Clean Code — A Handbook of Agile Software Craftsmanship by Robert C. Martin.

thanks for reading

Lawal Abdulateef Olawale

Written by

An active learner with low attention deficit.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade