From: Dumaiu Date: 2007-12-10T02:55:02+09:00 Subject: Re: How much would variable declarations in Ruby make you wince? On Dec 9, 12:07 pm, Bill Kelly wrote: > From: "Dumaiu" > > > This sounds like Trans's objection. But it's a post facto solution. > > Relentlessly refactoring and testing during development could fall > > into the 'premature optimization' category. > > No. Optimizing almost invariably makes code more obscure and more > complex. Thus the reason to do as little optimization as possible, > as late in the project as possible. > > The drivers for refactoring are completely opposite from those of > optimization. > > The point of refactoring is to improve and simplify the design of > existing code. Refactoring tends to become more difficult the longer > it is put off, and is more risky in the absence of good test > coverage. > > As such, it is ideal if refactoring can become a straightforward daily > occurrence; and a comprehensive test suite helps make this possible. > Some kinds of applications are harder to test than others, but it's > almost always worth it to find a way to write automated tests. > > In any case, comparing frequent refactoring to premature optimization > is just wrong. . . . > > Regards, > > Bill Perhaps I should avoid buzzwords. I admit that, having never actually looked 'optimization' up, I may define it more loosely than you. I didn't mean optimization for performance but for elegance. Ça ne se dit pas? The purpose of refactoring is to improve code by increasing elegance, unless I seriously misunderstand. My own tendency is to overthink it and try to reevaluate a design after every single change. I think this is another case where balance is best. If you have achieved such a balance with your "cycles," congratulations. I apologize if I offended you. -Jonathan