

Refactoring Rails tips from Yehuda Katz - imajes
http://www.engineyard.com/blog/2009/6-steps-to-refactoring-rails-for-mere-mortals/

======
teej
These aren't tips for refactoring Rails. Instead, these are the 6 steps you
should take -prior- to refactoring. This is an example of an editorialized
title that's pretty misleading.

~~~
rcoder
Actually, I think that most of these tips apply equally well to the pitfalls
you might hit mid-process while refactoring.

That being said, I think the basic points are obscured by the semi-random
ordering. Putting the same core recommendations into (my own, entire
subjective) order of importance, I'd probably present them more like this:

1\. Measure twice, cut once -- be sure you really understand a piece of code
before making changes

2\. Don't mix bug-fixing or feature enhancements with major refactoring work
(doing minor cleanup while fixing bugs is okay)

3\. Don't rip out + replace anything for which you don't have tests

4\. Make sure your tests cover real-world usage, not just your internal APIs

5\. Recognize when you're getting bogged down, and be willing to shelve or
abandon changes

6\. Set a concrete goal for your refactoring pass, and stick to it -- don't
try to rewrite everything in one pass

------
nexneo
Great tips to consider before any major refactoring task you planning.

------
Morten32
Thanks for sharing with me.<http://www.braindumps-central.com>

