I consider myself as a guy with OCD (obsessive compulsive disorder). Although, I am not in the prime of it, I still need somethings to be in an order. When I sleep, my mobile should be by me in a correct angle. My table should be aligned with the tile lines. I can go on and on if i talk about my ‘condition’. But, That is not what I am here to talk about.
I inherited this condition into my coding format as well. Although, I am not a developer who writes symmetrical nicer looking easily understandable commented codes( Psst, who does? ), I still can’t move on if I see a small space misplacement. If I see a code that repeats and feel like it can be inherited into a function that can be reused, I have to do that. And I did that. This happened for a while. But, The downside about this is we are not writing code to keep it on exhibitions. We write it to complete the projects which have tight timelines and deadlines. I frequently missed the deadlines and had to work for some more extra time to complete my task.
One day, On our weekly Leadership Wednesday, Our Visionary Aslam discussed with me about something called Red Green Refactoring concept from Test Driven Development (TDD) methodology. It was a great workflow and I follow that from that day. This is the excerpt of that workflow. That is, When you are trying to complete a task or fix a bug, You should always first go through the shortest way to fix it properly. Once you complete the task, move on to the most important task — refactoring or optimization. That will save you a lot of time and will help you complete your task within the allocated time period.