Code Quality – Keep It Simple Now or Program with the Future in Mind?

code-qualityfuture-proof

I'm currently coding a new application for my company that is rather involved. To meet the deadline, the functionality has been toned down quite a bit so that we can have something ready to go for launch.

I've been given the task of getting version 1 up and running by the end of the month. I'm about halfway through development and I've come to the point now that there is an end in sight.

Yesterday, I spent some time coming up with a very nice easy solution for one of the requirements and am quite proud of how it turned out. This morning the version 2 document was sent out, and there is a requirement in there that will require the code I wrote yesterday to be either gutted, or severely changed. It would require a lot of work in the future if I leave it the way it is. I can take an extra day now to make my current solution more robust so that the v2 feature will be able to be added with a lot less effort, but that will put me a bit behind for the extra coding it would require.

I don't know if I'll be doing v2. It might be me or it might be a co-worker, or even an intern.

If you were in my shoes, would you spend the time now to make it easier in the future, or would you leave your solution and deal with it when the time comes?

Best Answer

If the deadline is Carved In Stone, just finish what you have to meet it. Make sure that you inflate the estimates for v2 to accomodate for the code changes for the new requirement. Also be sure to briefly document what you think will need to change for the new v2 features so that a co-worker can pick it up if you're reassigned to something else.

If there's enough flexibility in the deadline (1 day, by the sound of it, so aim for 2.5 days extension) then sure, go ahead and code for the known future!

Related Topic