Cut and Paste, Search and Replace

8 AM February 10, 2004

I’ve been programming by the cut-and-paste, search-and-replace method for the last week. It’s boring, but I’m not sure it’s a bad thing.

We’ve been going for two months now, building the infrastructure as we’ve been building the application. With just one month left to go, we still have more than half the screens1 outstanding, but there are no longer any big surprises. With the pattern set by the infrastructure, each screen follows a simple, three-class recipe; the easiest way to make a new screen is to cut-and-paste an existing screen, search and replace the type names, fiddle with the contents of three or four key methods, and recompile.

We could have spent more time extracting commonality from the code, but chose not to. If we put our minds to it, we could have cut the per-screen line count by half, at the cost of making the infrastructure components more complex. However, one of the project goals is that the code be maintainable by programmers with minimal C++ experience, and we have had to strike a balance between absence of boiler-plate and understandability.

Even with all this boiler-plate, the code is still quite maleable. Adding a single extra field to an existing screen takes maybe an hour, including testing. Adding four fields only takes an hour and a half. This compares favourably with some big, Java based web-apps I have worked on.

So, despite misgivings and the boredom, it looks like I’ll be cutting and pasting for another few weeks. Sigh.

1 Screens, as in 80×25 and green.

By alang | # | Comments (0)
(Posted to Software Development and javablogs)

Comments

Add Comment




(Not displayed)






(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)




© 2003-2006 Alan Green