Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refactor code without IDE functionality (in Vim or TextMate)?

I wonder how do programmers refactor code that is written in languages like Ruby, Python?

Assuming you get code after a 'previous' guy—so you cannot be sure about quality of tests and their coverage.

Do you use any specific approach?

like image 465
ITmeze Avatar asked Jan 24 '26 06:01

ITmeze


1 Answers

Without an IDE, you will have to take smaller steps, well protected by comprehensive unit tests. Martin Fowler's Refactoring, written before all the software tools were available, is a pretty good guide to how to refactor safely. You take small steps, checking all along that you're not breaking anything, frequently leaving original code in place until the replacement has been completed. It's tedious but doable.

like image 188
Carl Manaster Avatar answered Jan 26 '26 06:01

Carl Manaster