Post by Uncle Buddy on Mar 8, 2022 21:34:30 GMT -8
The practice of parsing strings like "Herbert Khaury #42" or "Tiny Tim (stage name)" is causing a growing mountain of unwanted complexity in both code and GUI. Putting the name and ID in the same GUI field was originally supposed to be a temporary convenience thing, and a little voice told me I'd be sorry. But knowing what kinds of hurdles have to be jumped in some apps to find a person's ID, I kept the feature since I liked the accidental co-feature where you delete a character in a name autofill input, then retype the character, to get the autofill to show the complete name including the ID. But then I have to write extra code to not show the ID all the time since it's ugly. But then when I detect IDs by testing whether the string contains "#", it isn't always there. And round and round she goes.
Detecting "#" or "(" in a name input in order to drive logic also means the user can't use these characters in a name, which would normally be reasonable, but seemingly reasonable restrictions can prove undesirable in edge cases. I have to get rid of this runaround with the display name. It would be better to display a nametip on all names. Instead of displaying "Joe Blow (also known as)" for an a.k.a., you just display the a.k.a. and have a nametip, so when you point at most names the tip will display something like "#42 birth name" but if there's no birth name, something like "#56 also known as" will display in the nametip instead.
There will have to be separate inputs for the ID and the name. Currently you can get the name to fill in by inputting either the name or "#42" for example into a name field. That feature could remain as long as the ID is filled into a separate ID field.
Using the FocusOut event to trigger actions is often tricky because focus can be tricky, but I can't stop using it with my insta-change table cells, because comparing self.original with self.final is too important to the design, that is, comparing what's in the cell when you focus into it vs. what's in the cell when you leave it. Since focus events are already wiggly, I have to try to put nothing in the field to complicate the situation beyond that.
I have to refactor this name thing completely, it keeps getting messier and buggier and harder to extend. For one thing, you should not have to parse names to get an ID; the name and ID and widget are in the dict, and if not, they should be. There should be a birth name key:value, an alt name key:value which is only used as display name if birth name value is blank, and alt name might have a default value if it's also blank.
If anyone thinks I am guilty of not planning things ahead, that's sorta true of the first draft, slightly less true of the second draft, etc. I'd hate to take the spontaneity out of my encroaching senility by making perfect plans in advance, and as a programming neophyte I am only just learning how planning a feature that I've never tried to write before is even possible. But enough yik-yak, on with the show, slow by slow.
The moral of the story is, "Complexity in coding is like a fractal that keeps growing, except it's not pretty." When adding a feature breaks existing features, it's time to simplify.
Detecting "#" or "(" in a name input in order to drive logic also means the user can't use these characters in a name, which would normally be reasonable, but seemingly reasonable restrictions can prove undesirable in edge cases. I have to get rid of this runaround with the display name. It would be better to display a nametip on all names. Instead of displaying "Joe Blow (also known as)" for an a.k.a., you just display the a.k.a. and have a nametip, so when you point at most names the tip will display something like "#42 birth name" but if there's no birth name, something like "#56 also known as" will display in the nametip instead.
There will have to be separate inputs for the ID and the name. Currently you can get the name to fill in by inputting either the name or "#42" for example into a name field. That feature could remain as long as the ID is filled into a separate ID field.
Using the FocusOut event to trigger actions is often tricky because focus can be tricky, but I can't stop using it with my insta-change table cells, because comparing self.original with self.final is too important to the design, that is, comparing what's in the cell when you focus into it vs. what's in the cell when you leave it. Since focus events are already wiggly, I have to try to put nothing in the field to complicate the situation beyond that.
I have to refactor this name thing completely, it keeps getting messier and buggier and harder to extend. For one thing, you should not have to parse names to get an ID; the name and ID and widget are in the dict, and if not, they should be. There should be a birth name key:value, an alt name key:value which is only used as display name if birth name value is blank, and alt name might have a default value if it's also blank.
If anyone thinks I am guilty of not planning things ahead, that's sorta true of the first draft, slightly less true of the second draft, etc. I'd hate to take the spontaneity out of my encroaching senility by making perfect plans in advance, and as a programming neophyte I am only just learning how planning a feature that I've never tried to write before is even possible. But enough yik-yak, on with the show, slow by slow.
The moral of the story is, "Complexity in coding is like a fractal that keeps growing, except it's not pretty." When adding a feature breaks existing features, it's time to simplify.