February 15th

I’ve gotten so tired of tuning that I decided to set it all aside for the moment and work on some of the programming problems, foremost among which is the creation of routines that will write the HTML code that will be served to the client. This is quite a task: right now all the display routines use Java’s Swing technology, and HTML is laid out in an entirely different fashion. I am learning some correspondences that will make the task easier, but first I must address a dilemma: do I switch from Swing to HTML inside the same code, or do I use one class for Swing and another class for HTML?

At first glance, the choice seems obvious: handle both display methods in a single method. Use code looking like this:

if (we’re using Swing) { Swing writing code }

if (we’re using HTML) { HTML writing code }

Looks straightforward, right? There are a number of catches with this approach. First, each type of display likes to keep its own internal data structures. Swing uses JPanels, HTML doesn’t. So I end up with lots of data structure that goes to waste. I suppose that I can afford to waste RAM; nowadays it just isn’t a problem. Second, each of the different HTML displays requires its own CSS file; slithering back and forth between different CSS files could be very bug-prone.

Then there are the hidden gotchas: things I don’t realize yet that could be deal-killers. What if I run into an obstacle I never anticipated? I suppose that I’d better be ready to restore everything from backups. I’ll note the time and proceed from there.

So now I hoist up my trousers and head manfully into the forest of code...