Goldenseal Pro Progress- Shifting Gears (June 1)

We have not made much progress on Goldenseal Pro for Windows, ever since we closed as a non-essential business on March 23. Stepping back for a while made it clear that it’s time to shift gears.

Our original plan was to use MFC (Microsoft Foundation Classes) to build Goldenseal Pro for Windows. Best guess at that time was a year to finish. MFC dates from 1992, which is ancient in computer years. On the other hand, we already use some parts of it. Adding the rest seemed like it might be relatively easy.

Unfortunately, MFC really is just too darned old. Just about everything is awkward and painful. Just one example: for text, it may use LPSTR, LPCSTR, LPWSTR, LPCWSTR, LPTSTR, LPTCSTR, WCHAR or TCHAR, depending on the function. Choose the wrong one and the app shows garbage text, or crashes. It’s constantly frustrating, even with a cheat sheet.

Based on progress to date, it now looks like it will take 2 or 3 years to finish Goldenseal Pro, by using MFC. Maybe longer, since Covid-19 is likely to cause more delays.

Microsoft has other frameworks and programming tools that are newer than MFC. Most use C# or Visual Basic (their in-house programming languages). Last week I put all the options into a spreadsheet: 56 of them, and I probably missed a few. Everything from ADO to XAML. They have WCF, WPF and WF, but no WTF (though it ought to be there). Nothing has ever been retired: it’s the tech equivalent of a hoarder’s house.

The Windows team seems to be aware of the problem. WinUI 3 is their blueprint for a more orderly set of development tools. In theory, it will unite all the options into one flexible system, with much better support for C++ code such as ours. WinUI 3 just moved from ‘alpha’ to ‘preview’, whatever that means.

Originally, we planned to whip something out in MFC, and then gradually convert it to WinUI 3. Now it looks like it will be better to jump right into WinUI. We might as well experience the growing pains of a young platform, rather than the arthritis of a very old one.

Full release of WinUI 3 is probably still a year off, but there’s a half-baked WinUI 2.4 which we probably can start with.

It will take most of the summer for our staff to come to grips with the new plan. We will play around with sample projects, read books and online info, and then start on a prototype. We may need to learn C#. We may need to shift gears again, if Microsoft shifts theirs. We probably will need to make a few changes in Goldenseal’s interface, so it fits into their system.

Our lives would sure be easier if we could just write code once, and have it run on all desktops. So, I went back and looked again at cross-platform development tools, for the 4th or 5th time. QT and Wxwidgets are the best known, but there are a few others. This post sums up their problems in great detail. Somewhat cynical, but it’s the truth. Likewise for its picture of the fishes.

Dennis Kolva
Programming Director
TurtleSoft.com

Macintosh & ARM (Apr 23)

Bloomberg News reported today that Apple will start using their own A14 ARM chips in new Macintosh models. It will be a gradual transition away from Intel, starting in 2021.  This chip switch has been rumored for years.

Apple is “working on” a way to run current apps on the new chips. It’s almost certain to be similar to previous pivots (68000 to PPC, then PPC to Intel). First, there will be an emulator with mediocre performance. It gradually will get worse, then end after 5 to 7 years.

The future ARM Macs will be better at running iOS apps. That’s great if you want a big-screen, more powerful version of your iPhone or iPad. It’s not so great if you are running current Mac software.

Whether Goldenseal Pro will run on ARM Macs depends on Apple.

      • If they continue long-term support for Cocoa and Objective-C, then we can make it work with another year or two of effort. We’d start that when sure of Apple’s plans, and after the Windows version is done.
      • If Apple unveils something new for developers, then it depends on the details. Could be better, could be worse.
      • If Apple switches entirely to Swift and SwiftUI, there’s no way we can convert our code. After 33 years, it’ll be end of the line for our Mac version.
      • Ditto if Apple sorta supports Cocoa, but are half-assed about it. Cocoa is already a nightmare, and our staff is not eager to go back there. Since this is the likeliest case and Swift-only is 2nd, I’m glad we stopped work when we did. A waste of only 3 years instead of 4 or 5.

To keep current Mac users, Apple will need to support Microsoft Office and Adobe products for sure. Everyone else doesn’t matter very much. Specialty apps like ours don’t matter at all.

So, we just have to wait and see.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Coronavirus & Table Clicks (Mar 24)

Here in New York, the Coronavirus storm is upon us. 20,875 cases with 15 locally, and growing. Ithaca is almost a ghost town. Hopefully it won’t get as bad here as in New York City.

The John Hopkins Covid-19 Tracker has gone back to tracking US cases for each county. It gives a clearer picture of where we all stand right now. Keeping that site updated must be a ton of work, and I really admire them for it. Last week it stalled out a lot, but they seem to have added servers to cope with the load.

The bad news is, confirmed cases are distributed throughout the entire US: big city, small city, suburban and rural. Right now it’s worst in NYC, then Seattle. However, everywhere else is only a week or two behind. Most of the regional differences are from lack of testing, rather than lack of infections.

The graph of the infection count keeps getting steeper. If you click to see the daily increase, it’s the same curve. The rate of increase in that one is also the same curve. Exponential growth works that way. The rate it gets faster keeps getting faster.

The way this pandemic plays out in each part of the US will depend a lot on the actions of state Governors and state/local health departments now. Balancing physical distancing with the need to get groceries and pay bills is going to be extremely challenging. We’re all in for some big changes.

Meanwhile, our staff has settled in to the new normal: isolated and ultra-cautious. We are back to programming, again.

A few weeks ago, two different types of tables were filling in data and looking pretty good. Then we clicked on one, and it crashed immediately, somewhere deep inside the MFC library.

It used to be possible to step through MFC source code to figure out problems like this. Unfortunately, that has become more difficult with newer versions of Windows. One option gave thousands of error messages in the compiler. The other option took hours to load up. Frustrating.

Luckily, taking a break from problems is often a good thing. Coming back afresh, we quickly found a nice CodeGuru explanation for the fix.  It only took a few minutes in the Class Wizard to get it working properly.

MFC is old and complicated. It’s going to be a slog. But we are making progress.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Goldenseal Pro Progress- Tables & Beyond (Mar 2)

As of last week, breakdown tables are looking good in Goldenseal Pro for Windows. The code is clean and orderly. The appearance is pretty much as we’d like. It’s just a grid of little rectangles with text in them, but making that happen requires a surprising amount of code.

Many details are still unfinished, but our staff has moved on to other things for a while. There are several other types of tables in Goldenseal, and we might as well get them all working at the same time. We’ll come back to them after the entire interface is in place.

Table grids have a basic design issue: how do you enter data into the little boxes? Over the years, Microsoft Excel has approached it in two different ways: with a separate formula bar, and with an edit box that pops up when you click in a cell. Mac Finder and Windows Explorer edit in place after a delay, though it’s often easier to right-click and choose Rename.

The current version of Goldenseal also uses edit boxes that appear when you click. However, our tables are more complicated. Some cells are just text; some show a popup button and a menu list; some are check boxes or padlocks. It took a lot of programming time to get them working properly, and they still aren’t perfect.

When we worked on the Mac version last year, it was very hard to get edit-in-place fields working (especially for the smart fields that pop up a list of items). We finally gave up and tried a third approach: a separate window that pops up when you double-click in a row. Kinda like a little data entry window for a single breakdown item. It seemed like a big improvement over the current approach. Less cluttered, better use of space, easier to modify in the future. Most likely we will do the same thing for breakdown tables in the Windows version.

Right now we are working on Preferences, and the little windows that manage lists of payroll tax tables, cost categories, and many other details.

In the Mac version, there was a worrisome database bug that appeared when a breakdown table opened for the second time. Fortunately, it happened in the Windows version also, and it was easier to debug there. Working with code that is all in the same programming language really is easier. The bug wasn’t in the database code, after all. That was reassuring.

Dennis Kolva
Programming Director
TurtleSoft.com

Goldenseal Files and the Internet (Feb 18)

A long-time user recently posted a message about their use of OneDrive to run Goldenseal from multiple computers. They store company data in the cloud, rather than on a local drive.

A warning: we have not tested Goldenseal for use with files stored remotely on OneDrive, iCloud, DropBox, Google Drive or other remote file services. We designed Goldenseal to save data on a local disk (hard drive or SSD), or to a local server if you have the multi-user version. Saving files over the Internet is much riskier.

Many apps have relatively small files that are easy to keep in synch. Some apps with large files only add new info at the end of the file, so there isn’t much to change with each file update.

Goldenseal company files are more difficult because they are big, and because changes are scattered through the entire file. That makes it harder to sync data between two locations. For example, a new material purchase posts changes to the vendor account, the job account, and a couple of utility accounts. It may also updated prices in some Cost Items. All those records could be anywhere within the file. If they get out of sync, you will have mystery accounting problems later.

Even worse, if records change in size, Goldenseal will move them to somewhere else in the file where there is available space. If the indexes that store record locations get out of sync, the file will have serious problems. You may lose data, or the file may become completely unusable.

There definitely will be problems if more than one person uses a remote file. If two users both change a record at about the same time, one set of changes will probably be lost. You’ll get mystery problems later.

Even with one user, a remote file is more risky. Our code is careful to save all changes to disk at the same time, so there is only a small fraction of second when a crash could cause data corruption.  OneDrive and iCloud transfer data to and from the remote file at unexpected times. The update process may take many seconds. It means more opportunities for something to go wrong.

If you do decide to use a remote file despite these warnings, use the Verify File command frequently to check for file damage. Also, please send us the exact text of any error messages you see. It helps us make Goldenseal more bullet-proof. Most of our messages include the source code location where the problem occurred, so include that in your error report.  It makes debugging much, much easier.

Goldenseal multi-user currently uses Unix sockets to communicate over the network. It locks records while they are in use, so another user won’t ever conflict (they can view that record, but can’t change it).

To be technical, we use TCP/IP to send messages between clients and the server. They can travel over a wired or wireless LAN (local area network), or over an Internet connection. When a client looks for a server, it currently broadcasts via UDP.  That can’t go out into the general Internet. A few users have been successful at setting up a VPN (virtual private network) to allow UDP to broadcast over it, but the process is not easy. We tried it here but gave up.

As a 64-bit app, Goldenseal Pro can use more modern Internet access tools.  That will allow us to set up a local server that can be reached by any Internet-connected device: laptop, phone, pad or whatever.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Running Goldenseal on Macintosh (Feb 7)

For the past 5.5 years, this blog has covered our efforts to update Goldenseal into a 64-bit app. To summarize:

1. We did not finish the 64-bit update (Goldenseal Pro) in time for the release of Mac OS 10.15 Catalina last October.
2. The current Goldenseal 4.96 for Mac is a 32-bit app that will not run on Catalina or future Mac OS versions. It does run on Mac OS 10.14 Mojave and earlier.
3. The current Goldenseal 4.96 for Windows runs OK on Windows 10, and anything back to Win 98. However it has annoying screen drawing problems caused by its reliance on Apple’s QuickTime.
4. Goldenseal Pro for Mac is now on hold, and we are working exclusively on Goldenseal Pro for Windows until it’s done. The update removes QuickTime and its problem, and has many other improvements.
5. Whether we ever finish Goldenseal Pro for Mac depends on Apple’s future plans for Macintosh. Hopefully we will know more after the WWDC in early June.

In the meantime, our Mac users are upgrading to Mac OS 10.16 Catalina, or considering it. Here are some options on how to cope for the next couple years.

For less than $100, an External SSD in an excellent addition to any computer setup. If you have a USB 3 or USB C connection, it will run faster than an internal HD. 500GB is big enough to split into 2 or 3 partitions, so you can install a different OS version on each. Use Startup Disk in System Preferences to switch between OS versions.

Many iMacs and Mac Minis allow you to add an SSD as a second drive internally. It will be faster than an external, but it may be a difficult install. I updated one Mini that way, but will never do another.  It was a tight squeeze near fragile components. Too much risk of failure.

Since storage is so cheap, I think it’s wise to always install new OS versions on a new, empty partition, rather than overwriting your current system. That way you can test it out, and revert painlessly if needed.  Carbon Copy Cloner is a great way to move entire disk contents from one place to another, if you want to update the internal drive later.

In general, a Mac is optimized for the OS version that was out during its release. You can install newer OS versions, but not older ones. So any model from early to mid-2019 or earlier will still run Goldenseal using OS Mojave. Anything newer probably can’t.

If you have a big monitor and a second Mac, consider a KVM switch. It allows you to use just one monitor, mouse and keyboard, and move quickly between multiple machines. I personally use a 4-port ioGear DVI switch, with 3 Macs and 1 Windows attached (sometimes 2 & 2).  Most KVMs are in the $40 to $200 range. Be aware of the cable type (VGA, DVI or HDMI). You may need adapters if the computer age range is wide.

Finally, external hard drives are also cheap these days: e.g. $60 for 2 terabytes. Give them multiple partitions and you can use one for Time Machine, and the rest for backups and older OS versions. It may come in handy if there’s an app you want to run, that capped out at Sierra or earlier.

For the long haul, it’s still too early to predict where the Mac is headed. These days it is less than 10% of sales for Apple. They’ve prioritized accordingly for at least the past 5 or 6 years. On the other hand, Macintosh is still bringing in a steady $25 billion a year (about the same as Tesla sales for 2019).

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

 

 

 

Goldenseal Pro Progress- Windows & Macintosh (Jan 28)

Our staff is still working on code for breakdown tables in Goldenseal Pro for Windows. The starting point was GridCtrl sample code, available online. After removing 2/3 of that, we are now revising the remainder to include the best ideas from our original table classes (plus Cocoa’s NSTableView).

It’s possible we should have just started from scratch. But Windows and MFC have many quirks, and most likely we would have spent many frustrating weeks or months learning those the hard way. Better to use something that actually works at the start.

Meanwhile on the Mac side, it’s not looking good for the future of Objective-C and Cocoa.  All signs point to them being retired soon, and replaced with the new Swift language and SwiftUI framework. Moving to Swift would be much harder than Cocoa, well beyond our abilities.  So, it’s not looking good for the future of Goldenseal Pro for Macintosh either.

Microsoft is working on WinUI 3, which is a grand plan to modernize its developer tools. In theory, WinUI 3 will allow us to gradually replace our GUI code with more modern controls. They’ll look better, work more smoothly, and be more compatible with future OS versions.

Of course, Microsoft is a big corporation that doesn’t always deliver on its promises. Sometimes it produces products that suck. But at least their process is visible so we can plan around it. As turtles living under the feet of elephants, it’s kinda nice to know where they are headed.

Meanwhile, we filed a support incident with Apple Developer Tech Support in November, trying to get better info about their plans for Cocoa and Objective-C. We also emailed tcook@apple.com.

Apple DTS replied in late December that they don’t release future plans.  We then asked if anyone at Apple will talk with small developers like us. Yesterday they just replied again that they don’t release future plans. We didn’t hear from Tim or his assistants at all. We are still trying to find someone else at Apple who actually listens to developers, but it may be a futile task.

Back in TurtleSoft’s first decade, Apple had a dedicated manager for the A/E/C market (architects, engineers and construction).  Besides that, there were several other Apple employees that we could talk with. All that evaporated when Apple almost died in the late 90s, and it wasn’t replaced when they became prosperous again.

Swift and SwiftUI look great for building small phone apps.  They are not good for building large desktop apps such as ours.  We really need easy linkage to C++, and a promise that it won’t require major rewrites every 5 years. Windows delivers all that: if anything they have too much backwards compatibility. Apple has been the opposite, and they are getting worse at it.

It wouldn’t hurt for our die-hard Mac users to contact Apple, and let them know that you still need specialty apps that run on the Mac desktop. Otherwise, the future appears to be a Macintosh that is pretty much a big-screen iPad. Lots of pretty little apps but no software for business.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Goldenseal Pro Progress- Windows Tables (Jan 16)

In December our staff discovered a batch of C++ code online that makes spreadsheet-like tables for Windows. It didn’t take long to add their sample code to Goldenseal, and get it displaying a spreadsheet on the screen. It looked a lot like Excel for Windows 95, without the formulas. Not surprising, since the code was written back then.

Getting their code to be fully usable for our needs has been more challenging. Fortunately, we’re making steady progress on that. It really helps to see all the source files, and be able to change it.

First step was to remove unnecessary features. The ideal way to do that is to remove them one at a time, and test the code to make sure it still works after each removal.  Sadly, everything was too interconnected for that. So we hacked away and deleted everything all at once. Then spent a week fixing hundreds of error messages, until it worked again. Very similar to the demolition phase in a gut/rehab project.

With the raw framing exposed, we are now adapting the code to better suit Goldenseal’s needs. By the time it’s done, I suspect almost all will be rewritten. Some of the work is updating 90s code to modern standards. Some is plain old refactoring and redesign. For example, they store cells in columns then rows, but Goldenseal works better if they are in rows then columns. They use 0 for the first row, and we’d rather start with 1 like normal humans.

When we worked on the Mac version, Apple’s NSTableView class did have better overall design than the original Goldenseal. As we revise the Windows tables, it’s a chance to work in some of those improvements. This is the third batch of table code our staff has created, and each one is slightly better.

20 years ago, we thought Goldenseal would last for decades without big rewrites. Now we are more cynical realistic. The goal now is code that works well for the moment, and isn’t too difficult to adapt in the future.

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

Payroll Withholding Tables- US & Canada (Jan 3)

2020 has been a double whammy year for payroll tax calculations.

IRS changed the W-4 form. Instead of the number of exemptions, it now uses a complex calculation that involves dependents, student loans, multiple jobs and gross income. The only good news is that you won’t have to deal with any of it until the first time you hire someone in 2020. Then it’s just a one-time setup hassle.

We had to add a second set of tax tables to support the new forms: instructions here. Payroll will be more complicated for the next 5 or 10 years, until the day when IRS stops allowing the old forms. Then we can delete the old tables, and it will be simpler again.

Meanwhile, Canada also made a big change, replacing the personal deduction with a step table. We had to create a custom option in 2002 just to calculate Canadian withholding, and this change breaks it.

Revenue Canada has an insanely complex system to calculate withholding. The formulas use almost every letter in the alphabet, plus K1 to K4, T1 to T4, and 20 multi-letter codes. Ten different TurtleSoft employees worked on it and failed, before one finally figured it out. We are still slogging through the instructions to see how to make the new setup work. One of the calculation options for US states looks promising as a substitute.

As math nerds, we get especially frustrated by complexities like this, because it’s totally unnecessary. Tax dudes, you only need a few numbers to make it work!

Six US states have a simple flat tax rate for everyone. Most have a deductible, so taxation starts at some income greater than zero.  If you graph tax withheld vs income, it will be a straight line. Two numbers are enough to define that: one for the zero point, and one for the slope. In algebra, it’s y = a + bx.

Sales tax, gasoline tax and most other taxes are regressive. Poor people pay a higher percentage of their income on them, because rich people spend more on non-taxable stuff like school tuition and tax shelters. To compensate, it’s reasonable to have a progressive income tax. That means higher earners pay a higher percentage. If you graph tax withheld vs income, it will be a curve.

Mathematically, you can define progressive tax curves with three numbers: zero point, slope, and curvature. In algebra, it’s y = a + bx + cx^2 (the ^2 means x squared).

However, using exponents makes it too scary for most people. The easiest alternative is a step table, with different rates for each range of extra income. If you graph payroll tax vs income, it will be a series of straight lines that approximate the desired curve. Data-wise, it only needs two numbers for each step: start point and slope.

For any desired ‘tax curve’, it’s possible to make a series of steps that are accurate enough for tax policy. Most US states do exactly that, using anywhere from 2 to 12 steps.

Unfortunately, a few states add all sorts of weird stuff to make it more complex. Connecticut is an extreme example, with 13 different step tables arranged 6 layers deep. Presumably the tax committee was stoned when they created the Table C 3% Tax Rate Phase-Out Add-Back. Canada has a related problem: they really need some good tech writers to redo the tax guide, so humans can understand it.

Thankfully, we only spend a few days a year on payroll tax tables. Our staff will soon be back to more productive work, programming regular tables for Goldenseal Pro.

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

 

 

2020 Payroll Taxes (Dec 31)

Our staff is busy updating payroll tax tables for 2020. Sadly, US Federal income tax withholding has become much more complicated, due to a fairly small change.

New employees hired in 2020 or after will use a revised W-4 form. Their federal withholding then uses a different calculation method for gross income. Employees hired before 2020 will still use their original, old-style W-4 forms, unless they prefer to update.

To handle the change, we need to add a second US Federal Tax Item for the 2020 method. It also requires 3 new Tax Tables, plus an extra set of Tax Packages. The 2020 payroll import will add them automatically.

For states that use multiple Tax Packages, it’s going to be especially complicated: if there used to be 3 of them, now there will be 6. Users who have set up extra Tax Packages for child support or other complications may also need to revise them, and/or create new ones.

In your Employee accounts, you’ll need to assign different Tax Packages, depending on whether they use the old or new W-4. For employees using the 2020 W-4 forms, you’ll also need to enter a federal adjustment amount from the W-4, rather than the number of federal exemptions.

On top of all that, the IRS booklet uses an annual step table for the new calculation method. We used weekly tables in the past, but switched both versions to annual for 2020.  It’s bigger numbers, but ends up with the same results.

Most states use the W-4 for their own payroll taxes. Presumably they will also need to add a second calculation method. Most have not done that yet, but stay tuned. The chaos will probably reverberate for years.

Dennis Kolva
Programming Director
TurtleSoft.com