monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Code refactoring


From: Kevin Smith
Subject: [Monotone-devel] Code refactoring
Date: Thu, 13 Nov 2003 09:36:10 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20031024 Thunderbird/0.2

Last night, I started actually writing some monotone code. Working just in the commands.cc module, I found some aspects of the existing code to be difficult to work with.

How open are you (Graydon) to having me submit some refactoring patches to this module? These patches would only affect the structure of the code, and would not alter the behavior in any way [1].

The primary refactoring I would like to do is "extract method", with the specific goals of:

1. Reducing code duplication
2. Giving cohesive code blocks meaningful names (as methods)
3. Reducing the length and depth of the larger functions

The overarching goals are basically to make the code easier to understand, maintain, and enhance. For example, it will be much easier for me to add the filediff and filelog commands after the refactoring, because many of the building blocks will already be there.

Cheers,

Kevin

[1] Refactoring will often result in more run-time method invocations and object creations, which theoretically could slow the app down. As long as I confine myself to commands.cc for now, this should have no real effect on performance, which I know is a concern for monotone.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]