Browse thread
How to refactor a large Ocaml program
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Brian Hurt <bhurt@j...> |
| Subject: | Re: [Caml-list] How to refactor a large Ocaml program |
Mattias Waldau wrote: > Yes, editing and compiling until it works is a way to refactor, and I > used that method before. However, this only works if you know what you > are doing. In many cases you realize the change you made was stupid > and you have to roll back, i.e. undo or revert using CVS. I prefer subversion, but basically, yes. Ignoring for the moment that "always use version control" and "commit early, commit often" are good advice no matter what programming language or tool set you are using, undoing changes works much the same way- the compiler will catch the places you haven't switched back yet. In fact, it's not unusual for me to start making a change, update a bunch of places but not all, decide that isn't what I wanted to do after all, and partially undo the first change to make the second change. So now I have some places in the code that haven't been changed at all, some places which have been changed once and now need to be changed again, and some places that have been changed twice and don't need to be changed. Compile them all, let Ocaml sort things out. There may be an advantage to having an advanced refactoring tool, my point is that I really doubt the advantage will be the night and day difference it is in other languages. Brian