OOP (Jun 29)

Running a business is complicated. A construction business is more complicated than most, with plenty of quirks. Because of that, writing construction accounting and estimating software is a challenge. There’s always one more weird thing that needs to be handled.

To help keep the programmers sane amidst all that complexity, Goldenseal uses OOP: object-oriented programming. It uses code that looks more or less like the real world. With luck, OOP makes everything a bit more logical and easier to understand.

For example, to handle change orders, there’s a CChangeOrder class. It stores data for change orders, and does math and other tricks for them.

Object classes can have parents and siblings. The parent of a CChangeOrder is a CBreakdownTransaction (also the parent for all other transactions that have a breakdown table). Allowances have change orders as their parent. They inherit most of the same behavior as change orders, but tweak a few things that are different.

Our staff spends plenty of time designing objects and their contents. If it’s done well, coming back years later isn’t be too painful. Stuff still makes sense. If OOP is done poorly, then it turns out to be a confusing mess.

As we hook up Qt with our existing code, we find some of each.

All the data classes like CChangeOrder are great. No need to touch them at all. So far the database code is also working well.

Breakdown tables are more challenging. We had to write them from scratch in the original Goldenseal, so they have thousands of code lines for screen drawing, mouse clicks, and other interface details. Most of that is handled automatically by Qt table classes. Our staff is still figuring out what can be deleted from our old code, and what has to stay. Fortunately, we don’t need to clear out all the clutter right now. Sometimes it’s better to wait and be sure it really can be tossed. Sorta like cleaning the garage.

The hardest kind of OOP in Goldenseal is the link between what you see on the screen, and what’s stored on disk. We have a DB_RecordViewer class that handles that: record loading, saving, and everything in between. Its children are specialized to manage specific types of records: for example, CChangeOrderViewer for change orders.

As with tables, there is plenty of excess code in there. Newer frameworks already handle much of the nitty-gritty of screen display. We still need record viewers to handle the quirks, but they talk with a Qt object for most things.

Last winter we got records loading from disk onto the screen, and last week we got data saving from the screen back to disk. It’s coming along.

Dennis Kolva
Programming Director
TurtleSoft.com

Decisions & Breakdown Tables (June 14)

What amazes me most about the recent real estate sale efforts is how little time some folks spent on a such a big purchase decision.

One buyer sent her sister to look at houses. She viewed by phone, liked the first house they visited, and made an immediate offer. The contract was signed and accepted the same morning. My house was third on their list so they never got that far.

There is a saying: “don’t marry someone until you’ve summered and wintered with them”. That may be a general rule that can apply to all decisions. If so, it probably needs to be adjusted for decision size. That rule of thumb calculates out to between 1.75% and 5% of the final cost or investment, depending on how you figure seasons and marriage length.

If the logic is right, you should spend 30 to 90 seconds deciding where to eat lunch. A $100 tool deserves 4 to 10 minutes of thought. It’s worth 35 minutes to 1.5 hours of research for a $1000 computer setup, and 23 to 70 hours for a $40K truck. A $300K house purchase ought to get 170 to 500 hours of planning.

You can plug in your own numbers: the spreadsheet is at this link. My guess is that most people over-think small decisions, and under-think the big ones.

I’m still looking at Zillow and Realtor.com daily, in prep for a sale/purchase in March 2022. It will be a more educated decision then. The past few months I was busy finishing up construction work, and didn’t spend 170 hours on buying research. Maybe I can summer and winter with some of the fixer-uppers that are still unsold, and get a better sense of their flaws. Kinda like dating, with hunks of wood and masonry.

Meanwhile, our staff is back to making progress on Goldenseal Pro. Last week we hit a big milestone: smart fields now pop up a list of items when in a breakdown table. It’s a small bit of interface, but we never were able to make it work in Cocoa for Macintosh. MFC for Windows was even worse: we never got tables to work there at all.

Doing it in Qt took a few days of futzing, but that’s not bad. Most likely, everything that we need to do will be possible with Qt. Just a matter of time.

Dennis Kolva
Programming Director
TurtleSoft.com