We will practice refactoring CPP code using the open source project Iterated Dynamics. The following URL is the subversion repository:
Hello friends, This Wednesday is XpUtah. After speaking with Richard at this month's SlcAgileRoundTable, we would like to practice our CPP ["refactoring"] on the open source project, IteratedDynamics: http://sourceforge.net/projects/iteratedynamics/ To do this work will require a cpp compiler, a good editor and other cpp tools. We are posting some re factorings and other information on the XpUtah.org website: http://xputah.org/wikinew/NovemberMeetingTwoThousandSeven I look forward to seeing you there, Zhon Johansen zhon@xputah.org
Zhon Johansen writes: > We do work on the same thing. It is a small group (3-8), usually > working on some software project or other activity. The problem I see > with cpp is the lack of refactoring tool, requiring manual manual steps. This is a free version of the tool I'm using (its buggy for C++, but better than nothing): http://www.devexpress.com/Products/NET/IDETools/RefactorCPP/ - Richard
Zhon,
Some refactorings that could be done on this project:
complexity reduction; SourceMonitor will show plenty of candidates Extract Function, Replace Function with Function Object (for functions that have lots of intermediate state they keep in locals or file-scoped statics)
- encapsulate global variables; its got hundreds of them
- apply Template Method to various UI "dialogs"
replace polling I/O with event-driven I/O; this one is huge, I don't think people will have the stomach to do it, but if they can...
- eliminate duplicate code; there's still plenty left. Simian will find some of the easy targets
and some more I just thought of:
- create fixed-point integer math ADT to replace inlined ADT calls
replace homebrew Complex math with use of std::complex<T>
- create wxWidgets CGA text window control to migrate this code from homebrew windowing with its own "device" layer to wxWidgets for portable windowing with C++ classes
- replace array of structs containing function pointers with array of classes
-Richard
Also -- I've been doing TDD on this code to write some replacement parsers using the Boost library. To compile everything, you will need boost. However, the parsers are not yet complete enough to replace the existing parsers, so they are not strictly needed in order to compile and run the application.
However, since its all in one big project...
Visual C++ 2005 Express Edition (free MS C++ compiler/IDE for Windows) can be downloaded here:
http://msdn2.microsoft.com/en-us/express/aa975050.aspx
Boost is an open source library of useful C++ classes:
-Richard
