Clean code: the beginning
I still remember the time prior to 2014. I was working hard to understand object-oriented programming, design patterns, and practices. Also, I wanted to become good at technologies currently in hand (C#, ASP.NET, SQL Server and related stack).
But, everything (programming languages, tools, patterns, and practices) was scattered in my mind.
I was doing honest hard work but I had neither been able to think in an object-oriented way nor able to apply my learnings gracefully.
I was writing long classes (I was putting everything in a single class), long methods (I was putting everything in one method), uglier CSS, long SQL stored procedures, SQL views and other database objects were doing more than one thing.. in ugly ways.
I wasn’t able to apply thinking in terms of separation of concerns, coupling, cohesion, abstraction, and many more even after multiple readings. I realized that the X-factor was missing.
Slowly mess was building around my codebase.
I always had a desire to write good code. However, I was neither aware of code smells, nor the concept of clean code.
I had a perception that I am doing alright. However, I did not feel pride in what I was doing at that time because I knew it was not my best. The best from me was about to come.
During 2014, I came across this book — Clean Code: A Handbook of Agile Software Craftsmanship — by Robert C. Martin (Uncle Bob) — that changed my developer life. Upon reading the book, I practiced the tips, principles, and behaviours mentioned in there for more than a year. It changed my thinking, perspective, and mindset towards software design and helped me bridge the gaps.
Now the situation has changed. I view software engineering differently now.
I can figure out code smells much more easily and evolve clean solutions for complex problems.
Even if someone asks me to work with a codebase that is written in a programming language that is new to me, I am confident now that I can contribute meaningfully to the project.
The book helped me understand and apply SOLID principles,
refactoring techniques, TDD, design patterns and practices to projects developed in various programming languages and frameworks.
In my opinion, if you are a programmer, you must read this book and start practicing things mentioned in it pragmatically. You will witness a change in your skills for the better.
It will change your perceive coding. It really will help you to organize your code in a cleaner way. And I am sure, it will make your developer life easy.