Our staff went on a rampage last week, and deleted many C++ classes from the TurtleSoft source code.
Some were left over from the early days of Goldenseal development. Back in the early 90s, computers were s-l-o-w. It took at least 7 minutes to compile the app after any change. Bigger changes ran over lunch, or overnight. Really big ones took all weekend. It would have been even slower if we didn’t use the fastest possible hardware, at $7K a pop (1992 dollars).
For the first few years, TurtleSoft had two or three programmers. Because builds were so slow, we split many classes into parent/child files, using C++ inheritance. Smaller files were quicker to compile. Each programmer also could make changes on their own assigned files, without affecting the others. We merged files every Friday, before the big weekend rebuild.
TurtleSoft wasn’t the only code base using many generations of small classes. The PowerPlant and NeoAccess frameworks were also that way. Cocoa and Qt still are.
Having many small generations does have some advantages. But it’s more confusing, and it sure makes debugging harder. It’s kinda like having tools in a case in a bag in a toolbox, inside a cabinet in a truck in a garage. You’ll spend more time fetching tools than using them.
The frenzy started last week while adding right-clicks to smart fields. The None option erased the field OK, but the text came back later. Arrrrrgh! Debugging the problem went deep into old Goldenseal code. Four different classes were involved. Too confusing. We merged them into one class, and deleted the others. Then it was easy to fix the problem.
It felt so good that the rampage continued. Popup menus, buttons, checkboxes and text fields all shrank. It was like popping C++ pimples.
Once you start swinging a wrecking bar, everything looks like a wall that should come down. So we went through the list of source files, and deleted more that were obsolete. Another twenty or thirty bit the dust.
Shrinking the code base saves compile time, but that hardly matters these days. Even on a cheap Mac Mini, a full rebuild takes 62 seconds or less. Most changes only need a few seconds. The biggest gain is reduced clutter, so programmers are less frazzled and more productive. It helps to have a tidy workplace.
After all that fun, our staff got back to regular programming. Plenty of little details that still need work.
Testing sometimes turns up obscure bugs that have been around for years. For example, the warning about customers going over their credit limit is too strict when you change an existing sale. We found that by accident while testing something else. Now the code is more complicated, but exactly right.
Dennis Kolva
Programming Director
TurtleSoft.com