Coding 2025-01-30

By Max Woerner Chase

Okay. I took another look at my test code, and identified an area of potential improvement. Basically, there are some places where two variables are closely related, but this is only indicated by "thematic connections" in the variable names. Not good enough. The related values should be accessed through a single object, rather than next to each other in module scope.

From a typing perspective, I cannot "just reach into" one object and retrieve the other; there are too many layers of polymorphism/erasure. So, I need to create a new object to hold both values. I'm thinking a class with a constructor that takes a label (one of the object's types) and returns a decorator that wraps a function taking a label of the same type, and returning a command.Part (or possibly multiple?). This would have the additional advantage of associating type information that wasn't available before because of Reasons.

I was pondering before whether to make this generic (in an informal senseā€”it has to be generic in the label type, and being generic in the program type would be nice), or specific, and I'm thinking right now, I'll try making it specific. That will let me do some things that make the end-user interface more compact, which is a definite plus.

Anyway, I think those are enough notes to write this later. I'm sleepy now, so I'm going to wind down.

Good night.