Skip to main content

Development

Restraining clean freak of coding when it’s not necessary

Author Ricky Wang   Sr. Technical Consultant

A lot of colleagues around me are very familiar with some theory such as design pattern and code refactoring. I don’t want to repeat the benefits of them because everyone can blurt out some and it would be true if they can be implemented properly. The reality is some of us often join in a project halfway or at the maintenance phase. The code in front of us, most of time is not as clean as we expected. It may cause some negative effect to us since everyone should prefer something perfect. Also, well-designed and well-organized code could help us understand the project quickly.

In my last project, I met a similar situation and we had a defect reported in production environment. After figuring it out, we had two choices to fix the defect. The quick one looked ugly but was really an easy way to resolve the defect without a full deployment. Another one looked perfect but may cause much effort on redesign and testing. My leader told me he would like to use the easier way to solve the problem but let me make the decision after balancing them.

As a consultant, our responsibility is fulfilling customer’s requirement. What customers expect is a working application rather than a beautiful artwork. Secondly, at that time, testing team was busy with the migration test of another project. What we should provide in front of the defect is a quick response instead of fulfilling our clean freak. At last, I decided to do a quick-fix. We had a really quick response to the defect and low down the negative effects to the minimum. Customer was very satisfied with this. Later, we made the well-designed fix instead of it in another big release.

Both the quick-rough fix and the well-designed fix have their benefits. Considering the specific situation, quick response is the higher priority. That means if you believe something is good and worth to do, such as a good design, make sure to do that at the correct time. What we should always hold is the sense of high output-input ratio rather than insisting on something doesn’t make much sense. Sometimes, something useful doesn’t look beautiful. But when you stand on the view of the project value, a quick, simple, working solution does mean beautiful.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories
Follow Us
TwitterLinkedinFacebookYoutubeInstagram