2021-03-14
One of the useful skills for a developer is being able to adapt to changes. Whether it is technology changes, coding language changes, code structural changes or even requirement changes. A solid logic and a good understanding of the way we write the code is also important, we need to know why we write the code, the reason we code it like this, what is the purpose of each line of code. It is also good to understand the requirements, why they need this app or what is the expected behaviour of this app, what problems will be solved. Sometimes we need to dig deeper, and ask more detailed questions so we can deliver the expected result.
Also at some points, we need to re-visit our code or other developer's code to do some changes or to add a feature or to fix bugs. If the code is not following the good practice, we might spend some time trying to understand each line of code, and it might also be difficult to do the changes, as we have to refactor or even re-write parts of the code to a better structure. It happened to me, when I visited my own code for the fourth or maybe fifth time to make some changes. My code had become very messy, very hard to maintain, and even came to a point where it was really difficult to add or extend the feature. This happened because I was not following a good practice in writing a code.
There is a good practice for writing a code, which I tried to follow everytime I write a code, it is called SOLID design principle. They stands for: S - Single responsiblity principle O - Open closed principle L - Liskov substitution principle I - Interface segregation principle D - Dependency inversion principle