Clean Code: Changing my coding habits

When thinking of how to improve as a Developer or a Programmer, I am reminded of the principle of having clean code. In the rush of attempting to finish an assignment or complete a feature request at work, I forgot the principle of clean code, and that is something I want to change.

What do I want to focus on?

One thing from reading the first chapter of Clean Code that I would like to do more of is abstracting my code, and making it more readable. Some of the professionals that were featured in that first chapter had an amazing way of describing clean code practices. Using statements like “clean code should do what you expect it to”, is a profound statement.

Abstraction and making my code more readable are important to me for the sake of efficiency and ease of use. One thing that I have encountered throughout my professional career is that I spend a lot of time attempting to understand what a single 50+ line method is attempting to do. Through code abstraction, another author can spend less time understanding, and trying to decipher pieces of the code. This enables them, and myself to add features more easily, and avoid needing to maneuver large methods in fear of breaking the codebase.

What do I want to avoid?

I want to avoid ignoring error handling because other than the stack trace this helps us understand what issue developers are dealing with. This is something else that I feel can help with efficiency and ease of understanding. When dealing with errors there could be cases where errors that are not handled could end up being unnoticed until something larger occurs. In terms of efficiency when dealing with an issue this allows for developers to understand where the problem is coming from. Other instances could just be a better user experience, so the user is better informed.

In conclusion

Keeping in mind the principles that come with having clean code is simply reducing overhead for a project. These principles seem like they may get in the way of efficiency, but the opposite is true in that they enable it.

I want to improve my own coding habits by abstracting my code, and always including proper error handling throughout anything I write.

Print Friendly, PDF & Email

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *