Coding 2021-12-18

By Max Woerner Chase

Wish me luck, I'm going to try to clean up the code a little. Basically, since a lot of this code isn't hooked up to anything, I'm safe to mess around with it without having to consider what it'll mean for the project's own motrfile. I'm switching over to the subclassing-based solution, so let's see what the necessary changes look like.

The system that I'm replacing was using Literal types to represent different programs. Which is mostly fine, but it has a bunch of minor shortcomings, and it also looks really strange. The basic point of all of this was to use these literals as marker types. But repurposing literal types for this was awkward and inflexible. To my mind, I'm not really running the usual risks of a subclassing-based interface, if the classes only really do anything at the type level, so they never actually get instantiated.

Anyway, that was all pretty simple. My next issue is splitting up the types module. The problem there is where to put them. As long as the cli package is mostly a bundle of related things, I'd rather it not be a bundle of two kinds of things. For now, and this doesn't seem like an objectively great solution as I type this, but I haven't thought of the better one yet, I'm going to split off these new modules into a cli_types package. Let's see how that works out for me.

First I'm going to add the package and just make sure the bare package doesn't somehow break anything. Now, let's see what it takes to split out the Key code into its own module. While I was working on this, I noticed something that I think I like more as a way to handle some of the functionality, so I made that change at the same time because, like, whatever.

Okay, I went and pulled that functionality out into its own module. Next up is... Let's try the Registry classes.

...

I now realize that the distinction between "Objects" and "Items" is... obscure at best. I'm not totally sure what to do about that. I'm just going to leave it as-is for now and sleep on it for a bit. Anyway, let's finish up this migration.

...

I'm not focusing super-well right now, so this is going a little slow.

...

All right, it's late, but I've successfully pulled out two modules. It turns out they were pretty small, so I didn't really cut down on the main types module yet, but in time...

Anyway, there's no way I'm getting anything else done tonight, so I'm calling it here.

Good night.