From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8456FBC0B for ; Thu, 14 Dec 2006 14:48:03 +0100 (CET) Received: from smtp.janestcapital.com (www.janestcapital.com [66.155.124.107]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBEDm2jL020381 for ; Thu, 14 Dec 2006 14:48:02 +0100 Received: from [192.168.250.117] [209.213.205.130] by janestcapital.com with ESMTP (SMTPD-9.10) id A60E0220; Thu, 14 Dec 2006 08:47:58 -0500 Message-ID: <4581560E.6020109@janestcapital.com> Date: Thu, 14 Dec 2006 08:47:58 -0500 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mattias Waldau Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to refactor a large Ocaml program References: <457FF423.7000703@abc.se> <45800CD5.8050401@janestcapital.com> <458106BD.7060103@abc.se> In-Reply-To: <458106BD.7060103@abc.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45815612.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; refactor:01 ocaml:01 mattias:01 waldau:01 refactor:01 compiler:01 ocaml:01 cvs:01 wrote:01 compile:01 caml-list:01 partially:02 compiling:02 programming:03 languages:03 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