Goldenseal Pro Progress Report- Sept 20

We are gradually ramping up the programming work on the Mac version of Goldenseal Pro, accounting software.  

After starting on the interface classes, we soon realized that almost everything needs to be written in Objective-C. That is the only way to hook into our existing C++ code.   We were really psyched to use the newer Swift language, but switching between three different languages drove us nuts.  Partly because different concepts, but mostly because the punctuation is very different. So, Swift is out, unless we find good reasons to use it later.  We will still use Swift for future iPhone/iPad development, because that will be entirely new code that won’t need to integrate with anything old.

Back when we tried subcontracting the upgrade work, the contract had 6 payment draw stages of approximately equal sizes.  Draw 1 is to open a list window (for example, anything from Options-Payment Terms), and then view and save list records.  Now that the programming work is in-house, we will use the same milestones.

We are still climbing the learning curve for Objective-C, but the Pro version already has menu commands that open windows and show a list of items. We still need to link it to the database and have it load screen layouts, then that will finish draw 1.  This is also the time to design many basic structures, which is good reason to take it slow, and do it right.

The Cocoa framework was developed in the mid-1980s for the NextStep computer.  It’s a ‘black box’ with many nifty features, but it can be challenging (especially for large apps like ours). We aren’t the only ones who still need a major rewrite: Microsoft is finally releasing their first Cocoa and 64-bit code this year, in Office 2016. 

On the plus side, Cocoa lets you build a lot of interface with very little code.  It’s going to allow some nifty improvements to the Goldenseal user interface. For example, popup buttons you can access from the keyboard.

On the minus side, Cocoa is hard to debug, and lacking in practical documentation. We have been perusing open-source projects, just to see how other people handle ‘the basics’.  Cocoa is also changing constantly, so at least half the answers for it in Stack Overflow are outdated and incorrect.  We have learned to check the date on all books and online info.  Much before 2013 and it is probably wrong. Anything after 2014 will be for Swift, not Objective-C. The ‘sweet spot’ is very narrow!

Some year soon, Apple will probably change the Macintosh from Intel to their own ARM chips.  Most likely they will also replace Cocoa with a new Swift-based OS, though that will be an enormous project.  We’ve learned our lesson, and are now designing things so the next remodeling round will be easier.

Dennis Kolva
Programming Director

Goldenseal Pro Progress Report #10 (Sep 6)

Our staff now has a decent grasp of the new Swift programming language, and the basic Cocoa libraries.    It will take a few months to get fully up to speed, but we are ready to start coding.

Our contractor wrote quite a bit of startup code in Objective-C, and we are reviewing it now to see how much can be salvaged.  We may need to start over entirely, but it’s worth spending a week to understand his code, and decide what to keep (and how to merge it).  If nothing else, we need to learn enough Objective-C so we can link our C++ to Swift.

It took us about 2 months to move Goldenseal from Mac OS 9 to X, and 2 weeks to move it from PPC to Intel.  Unfortunately, this is going to be a bigger transition.  Hard to estimate right now, but it will be months, not weeks or years.  A lot of the time will be “learning curve” that will pay off when we start writing apps for iPhone and iPad.

Dennis Kolva
Programming Director

Swift vs Objective-C

Our staff has been getting “up to speed” with Cocoa, so we can build the Macintosh GUI (graphic user interface) for Goldenseal Pro.  It will probably be another week or two before we are ready to start writing code.

Swift is a new programming language that Apple introduced in 2014.  It is designed for rapid GUI development, and we are finding that it definitely works well for that.  It’s possible to create fairly complex apps with just 20 or 30 lines of code.

Swift is a young language, and still evolving. We are writing practice apps using a book from The Big Nerd Ranch dated April 2015, and about 25% of the code in the book has changed since then. They put updated code on their website, but some of that has changed since it was posted. There are even more changes coming when version 3.0 comes out this winter. Using Swift for development will definitely be “bleeding edge” technology for a while longer.

On the other hand, the Objective-C language is old (first developed in the early 1980s) and ugly. Nobody uses it except for Cocoa developers, so it is doomed to fade away, as Swift takes over.

We have been working with both, and will use Swift for Goldenseal Pro.  Better stabbing pains for a while, than a dull ache that goes on forever!

The good news is that once we have mastered it, we can also use it to develop apps for iPhone and iPad.  Our original plan was to subcontract that work, but we can probably design and build apps in about the same time it would take to write specs, supervise and test someone else’s code.  Annoying to have to learn new stuff, but worthwhile in the end.

Dennis Kolva
Programming Director

Goldenseal runs OK in Mac OS 10.12 (Sierra)

We just tested Goldenseal with the public beta version of the next Mac OS (10.12 Sierra).  Everything still runs as it should.

The only problem we found is that the blue-highlighted OK buttons in dialogs are hard to read. The ‘flat’ buttons in OS 10.10 and newer have a dark background that is designed for white text, but our code still draws the text in black.

Goldenseal Pro won’t have this problem, and it is far enough along that we probably won’t fix this appearance issue in the current Goldenseal app.

HINT: if you click on the colored button and then move the mouse cursor off the button temporarily, the blue turns to white so you can read the text.

Update: Gears Shifted

After some discussion with our contractor, he has decided to stop work on Goldenseal Pro.  He did a good job on the early parts of the project (opening files, reading resources) but did not have enough Cocoa experience to get anywhere with the GUI (graphic user interface) for Mac.

This is the second contractor who stalled out after a few months. There were two others who gave up after a few weeks.  I think it is just too large a project for most programmers to handle.

The good news is that we’ve finished the prep work and programming that we needed to do.  So, we will start work on the GUI with our own staff.  We are already very familiar with the existing code, so there won’t be any “learning curve” there.

The plan is to get the basic GUI working, and then subcontract a few remaining details (printing, networking, Custom Layouts).  Those will easier for folks to bid on and complete, and they can also be done in parallel.

One wrinkle is that the Swift programming language is currently getting a complete rewrite, with a new Swift 3.0 planned for completion in late 2016.  It is not backward-compatible, so anything written in Swift 2.0 will need to have some parts rewritten.  However, it will not take much Swift code to create the GUI, so that change will not affect us by much.

Dennis Kolva
Programming Director

Goldenseal Pro Progress Report #9 (Aug 17)

The contractor who is working on Goldenseal Pro got “stuck”.  He wrote new GUIs (graphic user interfaces) for Windows and Mac, but has not been able to connect them with the database, or our business logic.

We are reviewing his code now, to see how to fix that.  We are also discussing ways to make things go faster.  We are eager to see it finished this year.

Most likely our staff will take on a larger portion of the development work, and we will contract smaller parts of the project.  Our experience over the past two years seems to be that many programmers think they can successfully complete a large job like this, but very few actually can do it.

Dennis Kolva
Programming Director
Turtle Creek Software

Goldenseal Pro Progress Report #8 (July 29)

We have shifted gears, and are reading up on all the stuff we’ll need to know for writing our own GUI (graphic user interface) code. That applies to both Goldenseal Pro, and the small phone apps we will link to it.

On Windows, that means developing with Android libraries, using the Java programming language.  On the Mac, it means using Cocoa libraries, and a combination of the new Swift language, and Objective-C.  On desktop it also requires Objective-C++ to link to our existing C++ code.

The number of libraries and new languages is daunting, but fortunately it is not as bad as it might seem.  All of the libraries use concepts that are very similar to what we already use. And all those new languages are pretty much derived from C++.  The syntax may be different (some have semi-colons and some don’t) but the coding is the same basic stuff.

Meanwhile, our contractor is currently on vacation, but he is going too slowly and we’ll have a discussion with him soon.

With both Swift and Java, it’s possible to develop a GUI with very little actual coding.  The hard part is linking it to our existing code.  If we write the Pro GUI in Swift, it’s going to involve four different programming languages!

C++ is a great language, and getting better all the time. Unfortunately, it seems like Apple, Google and Microsoft all want to lock developers into writing code that can’t be used on other platforms.  Nice for them, sucks for us.

Dennis Kolva
Programming Director
Turtle Creek Software

Goldenseal database code (July 19)

We are still fine-tuning our basic database code. It is a gradual process since it requires testing, and making design decisions.  This is pretty much the last programming we need to do, outside of the GUI (graphic user interface).  Our contractor is making slow progress on that.

We use a B-tree to store the disk location of every record.  It is a popular design that is similar to the older NeoAccess code.  However, we make each node much wider, thanks to the generous amounts of RAM available on modern hardware.  It’s also faster that way: these days, a 64K read takes much less time than 16 4K reads.

Neo had a complicated system to keep track of empty spaces in the database (necessary to keep the file from becoming huge).  It was buggy, so in 2003 we replaced it with our own File Manager.  The new system performed well but took up a big chunk of memory, which sometimes caused quits or file corruption when there was not enough RAM to load it. In theory we could have rebuilt the FileManager from the NeoAccess records, so corrupted files could be fixed.  Unfortunately, the Neo code was so complicated that we never could make that happen.

In Goldenseal Pro we now use multiple File Managers, so each keeps track of records in just one sector of the file (32,000 records). They have a relatively small memory footprint, so they’ll be quicker and safer.

In the new database, the location of every record is stored in two different places, and now it uses code that is easy to understand. That means we can cross-validate them, and fix any errors.  Our own company file actually has a few corrupted records from the early 2000s, so it will be the perfect test platform for developing a self-repairing database.

The classic B-tree requires ‘branch balancing’ code to keep it in shape, and part of the complexity in NeoAccess was that it kept moving things around to balance the tree.  We add ID numbers sequentially, and most users don’t delete many records.  Our initial design takes advantage of those conditions, but we are still researching other ways we can make it better.

Dennis Kolva
Programming Director
Turtle Creek Software


The 90-90 Rule

There is a saying in software engineering that the first 90% of the project takes the first 90% of the time, then the last 10% takes the other 90% of the time.  For brand-new coding, I think it may even be a 90-90-90 rule, where the final 1% takes the really-last 90% of the time.

Anyhow, our new database code is working pretty well now, though we still need to test it on really large data sets, and stress-test it over the summer.  In other words, the second 90% is now completed.  Everything is much simpler and safer than the old NeoAccess code, so it will be much easier to maintain.  It’s designed for modern systems and uses modern C++.

We also finished the code that reads existing Goldenseal files, and writes them to the new file format.  That means that people’s existing Goldenseal data will be very easy to move into Goldenseal Pro.  We will be testing that code as well for the rest of the summer.  We’ll run Turtle Creek on the new version for a while, before opening it to beta testers.

Dennis Kolva
Programming Director
Turtle Creek Software

Website outage July 6/7

Our ISP had a server melt-down, and was out of commission July 6 & 7, and possibly partial days on either side.  It’s back in action now (Fri, July 8).

Emails sent to us during that period were temporarily delayed.  We have a big pile of old messages now, but it is possible some were permanently lost during the outage.  If you sent us an email recently and don’t get a reply today, please resend.

Our apologies for any problems this may have caused.

Dennis Kolva
Programming Director
Turtle Creek Software