Talk is cheap. Show me THE CODE

Talk is cheap. Show me THE CODE

Clean Code - Introduction

Our society is running on software. Always running software. You cannot do anything without software. Even you can't withdraw money without software.

I have a question. Who are the most powerful peoples in the world?

In my opinion SOFTWARE DEVELOPERS are the most powerful people in the world. You are thinking I'm kidding. I'll give an example. Do you know how many people have smartphones today?

In 2021, the number of smartphone users in the world today is 3.8 Billion, which translates to 48.20% of the world’s population owning a smartphone. In total, the number of people that own a smart and feature phone is 4.88 Billion, making up 61.90% of the world’s population. (Source:?https://www.bankmycell.com/blog/how-many-phones-are-in-the-world)        

48.20% of the world’s population owning a smartphone. If you can find a way to blast a phone, you can remove 48.20% of the world’s population from the world. So now you can understand the power of a DEVELOPER.

But we have ethics. So we don't do these things.

On the other hand, if the developer doing a mess when coding, he can kill a person.

Do you know how many code lines are in a car? Simply think, the car's brake system is working using the if statement. If one developer does a dump of shit code to this if statement, he can kill more than 100000 people.

Therefore we must have rules when coding. If you are a developer, you must have the ability to write clean code. If your code is a mess, sometimes your code can kill a person.

Assume you are a strategic developer with good knowledge. So what are the things which slowing your coding speed?

The main reason is the code has a mess. If the whole code has a mess, the speed of the developer is slower, slower, and slower. Remember, it's not done when it is work. We are done when it is right.

A good developer's job is not only a working code. You have to maintain a clean code. In my opinion, a not working clean code is better than a working messy code. Because if a code is clear, we can make that code into a working code.

Clean code is simple and direct. Clean code reads like well written prose.


What is a clean code?

Clean code is code that other developers can easily read, understand, and maintain It’s easy to write code that just the machine will understand or code that just you understand, but that proves problematic in the long run. Software developer's most important part is to write a code that others can maintain. Simply if your code is easy to read, easy to understand, and easy to change, you are a good developer which has awesome skills.

If your peers can understand the code, computer definitely understand the code



Why developers don’t do it?

No one can write a clean code first. Because people can't think in a nice straight line. We always thinking using if, while statements. Because it's just too hard to get the code to work. We add piece by piece of code and building a code. And suddenly it's working. But sometimes we didn’t know why it's working ??. Now the code is working. But it will be a mess.

So that the moment, which the developer has to clean the code. Roughly cleaning took the same time which you used to write the code. And that's the main problem nobody cleans the code. Writing bad code takes a whole lot less time because it’s not as very heavy. Clean code takes a lot of time and careful thought to plan for. But when developers are faced with tight deadlines, poorly written code might be their only option. That’s why it’s important for managers to offer generous deadlines so the development team can take its time to create really functional code.

And also in practice, most of the developers out there just don’t do it. Why not? For starters, some of them just may not have the knowledge base. Take a junior developer, for instance. If they’ve only worked on small projects or with more senior developers who aren’t motivated themselves to write clean code, they’ll never learn how to do it for themselves.


Why clean code is important?

Like we discussed?before, poorly written code may be faster in the short term, but in a few months, you’ll be glad you made the investment in clean code. When you’ve taken the time and effort into your code’s design, adding new features, fixing bugs, and collaborating with other developers will be much easier.? Because messed-up code slows down the developer's speed.

It's not done when it is work. We are done when it is RIGHT.


How to maintain a clean code?

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find the root cause. Always look for the root cause of a problem.

We must focus on how to clean up our code and become a productive developers for our team.

要查看或添加评论,请登录

Dulan Lokunarangodage的更多文章

社区洞察

其他会员也浏览了