|
Re: Architecture the Accelerator
|
Posted: Feb 27, 2005 1:37 AM
|
|
> We may not be able to afford a big increase in quality, > but we can always afford a small increase in quality. We > should all take the attitude that when we'll leave the > code better than we found it.
Thanks for clarifying. That sounds very reasonable. I think when you said that the only way to go fast it to write "the best code you can possibly write" I thought you meant we should always write the best code we could possibly write.
Michael Feathers talked about how if you make incremental improvements each time you go in you can amortize technical debt over time without anyone feeling a big single time hit. I think that makes sense, and I really like your call for leaving the code better in some way than we found it, because that seems inspiring but also very affordable.
The question I'd be curious to hear your thoughts on is how do we know how far to go with our improvements? For example, I have promised some functionality to some of the C++ Source guys to add one JSP to serve as a column home page. They've been waiting a long time for it, so I'm well past my arbitrary deadline. I want to get it done very soon. The easiest way to do it is to simply copy archive.jsp over to column.jsp and start making changes. Were I to do the best code I could write, I would first refactor archive.jsp off into our poor man's struts MVC design, because right now it is a monolithic JSP, with business logic mixed with presentation logic.
I have done that poor man's struts refactor many times on other JSPs. It takes about an hour. Then I can write tests for the controller portion, which would take another hour at least. If the actual work only takes about an hour, then I am looking at 1 hour to just create a column.jsp that is a monolithic JSP, and 3 hours to both refactor archive.jsp and then get a higher quality, MVC-organized column.jsp. Even if I did that work the code wouldn't yet be "the best code I could possibly write," I'd need to invest even more time to get it that good. That's why I said that in the short term, the higher quality can slow me down. Since I'm planning on in effect obsoleting this code in the next year, it doesn't seem worth it to me to do the refactor. I'll probably write column.jsp as a monolithic JSP with business logic mixed with presentation logic.
In general, how would you recommend developers decide how much to improve code, how much to refactor, how much to test?
|
|