Post by Uncle Buddy on May 28, 2022 6:18:47 GMT -8
It's too late in the day to decide for sure but it looks like tomorrow will be another fresh start on the families table. I took a long break from it and when I got back to it, I found it a brittle masterpiece of bandaids and patches that took shape as a sort of tentative fix layered on top of a trial run on top of a groping in the dark. The result is a nice-looking families table that almost works, but the code looks like a Picasso; fixing one thing breaks another. When things get to this point, a restructuring is generally the most efficient strategy. Anything else is just gonna be another layer of bandaids on something that wasn't planned very well from the start.
I believe this is also how the Great American Novel gets written. There might be some writers who just pop out finished masterpieces the first time, but I'd guess that most writers are just learning the territory the first and second times through. I can't tell you how many times I've rewritten this feature. I don't remember.
The general design will be kept. Treebard's families table is a scrollable window inside the current person tab, above the events table, occupying about 2/3 of the width of the screen. At the top of the families table is a bordered area for the parents and alt parents of the current person. There are two permanent inputs for biological mother and father. Under that, if the user creates an adoption, fosterage, or guardianship event, two more inputs appear for alt parents. Generic labels such as "foster parent" can be changed to "foster mother" or "foster father", for example, by double clicking the label to open a tiny dialog.
Under that is the progenies area where every one of the current person's partners and children is displayed at the same time. A vertical scrollbar will appear if it's needed. I believe that displaying all the person's families at once is unique to Treebard. Most apps require the user to click away from one family to view another, but Treebard's goal is to show all at once the whole story of one person's life without having to visually leave one place and go to another where you will have to try to remember what you just saw. Or click back and forth between them, for example to compare dates. The family table will be sorted by date. Partners are added to the table based on both marital events such as wedding, marriage, divorce, etc., and on child events such as a birth or adoption.
Partners will be labeled the way that the user enters them, not automatically as "spouse", "husband", or "wife". Treebard never assumes moral or religious traditions, but the user is free to do so; he can call anyone a spouse if he wants. I ran into a situation where a couple had a daughter and an adopted son. So on the man's current person tab, his wife appears in his families table labeled "Mother or guardian of children" with the two children listed under that. In the events table below, pointing at the guardianship event tells you which child they were guardians of. Pointing at the offspring event tells you which child they were the parents of. Just while writing this, I realized the label will be even more complicated if I remember to give the couple a marital event. Something like: "Legal guardian or mother of children (wife)".
All this is not as easy as it sounds, but historical accuracy demands it. If Treebard is going to be an example of a family-relationship structure that reflects the real world, then that is the goal, not some intermediary goal along the way. Treebard has to prove that the difficulty of doing it right is not rocket science. If I can do it, any real programmer and even a lot of amateurs can do it better. But the data structure behind this is simple. Not as simple as existing genieware, but simple nonetheless. So if a genieware creator doesn't want to try and do so much in one families table, this same data structure could be used behind any number of different GUI designs. But Treebard is where the action is right now, so:
In the progenies area, each partner has a heading where his/her kin type will be labeled, e.g. "partner", "spouse", "father of children", followed by their name.
Separating the partners from each other, there's an indented list of that partner's children with the current person. Each child's name, gender, birth date and death date are listed in a table.
Under the progenies area, an input field allows the user to enter new children for the selected partner. I haven't even started this important feature. I just realized that the only reason I haven't started the Add Child feature is that it's at the bottom. That's not a good reason. I think I'll do that part first this time, in case it's not easy.
All the person inputs in the families table are autofills, so the user can start typing and tab out when the right person fills in, or input a new name and a plus sign to add a new person, or a number sign followed by the person's ID, or any name stored for the person, such as a nickname or a membership number down at the Elks Lodge. If the name is spelled the same as an existing name in the database, a dialog will open so the user can select the right person by that name or create another one. Any of the person inputs that contain a name can be double-clicked to change the current person to the clicked person. Pointing at any of the names will open a small tooltip which will display the person ID and name type of the pointed-at name.
None of this is theoretical, it all works. Except the feature I mentioned which I haven't started. The problem is that it's so complex, and has been patched together in a series of experimental dashes for the finish line, that the result is a maze of code that can't properly be finished. It's gotten to the point where fixing one small problem creates another big or small problem. Staring at the code for hours doesn't encourage it to fix itself. Life doesn't have that many hours in it. So to save time and frustration, I will keep the GUI as is and rewrite all the code that makes it work. As usual, I'll trust that I've learned something since I started the families table, and literally delete all the logic code and rewrite it from scratch. I've already rewritten some features more than once, and tossed out other features that were redundant or supefluous. Now that I know what my goals are, it will still be hard to get this much functionality into one small table, but it won't be impossible.
What never works for me is using broken or fragile code as the model for new code. The key to my strategy, which I've used over and over, is to not even look at the old code except for very specific segments that can be plugged in to save time. Just delete it and start over, trusting that I've gained enough experience to do a lot better this time. This sounds more time-consuming, but it's not. I don't have to bang my head against a bunch of patched-together code, trying to figure out how it worked, or which part was broken, or which part was conflicting with what other part. Or how many lists & dictionaries I've created to hold the same data.
One reason this families table has gotten so discombobulated is that in order to even get this far with it, I've had to take time out to restructure older, big functionalities. Since the time, long ago, when I finally bagan the families table, I've totally rewritten the way that new color schemes are communicated to the app. Treebard is built around the user's ability to make his work easy to read and easy to look at. Fonts can be changed, and I had to do another full rewrite on that functionality. I made a huge change in the database structure which makes everything easier. So this time, when I start writing the families table logic, I'll be standing on much firmer ground and have a sort of mental map of how things should be.
The screenshots show a big complex family table scrolled to its two extreme positions. I think all this trouble is well worth it so the user can see a simple picture of a person's life with the flick of a scrollbar or mousewheel instead of clicking back and forth among several families displayed in different places. (All the names are pretty much random, just whatever popped into my mind. The final sample tree someday will be considerably more sensible.)
I believe this is also how the Great American Novel gets written. There might be some writers who just pop out finished masterpieces the first time, but I'd guess that most writers are just learning the territory the first and second times through. I can't tell you how many times I've rewritten this feature. I don't remember.
The general design will be kept. Treebard's families table is a scrollable window inside the current person tab, above the events table, occupying about 2/3 of the width of the screen. At the top of the families table is a bordered area for the parents and alt parents of the current person. There are two permanent inputs for biological mother and father. Under that, if the user creates an adoption, fosterage, or guardianship event, two more inputs appear for alt parents. Generic labels such as "foster parent" can be changed to "foster mother" or "foster father", for example, by double clicking the label to open a tiny dialog.
Under that is the progenies area where every one of the current person's partners and children is displayed at the same time. A vertical scrollbar will appear if it's needed. I believe that displaying all the person's families at once is unique to Treebard. Most apps require the user to click away from one family to view another, but Treebard's goal is to show all at once the whole story of one person's life without having to visually leave one place and go to another where you will have to try to remember what you just saw. Or click back and forth between them, for example to compare dates. The family table will be sorted by date. Partners are added to the table based on both marital events such as wedding, marriage, divorce, etc., and on child events such as a birth or adoption.
Partners will be labeled the way that the user enters them, not automatically as "spouse", "husband", or "wife". Treebard never assumes moral or religious traditions, but the user is free to do so; he can call anyone a spouse if he wants. I ran into a situation where a couple had a daughter and an adopted son. So on the man's current person tab, his wife appears in his families table labeled "Mother or guardian of children" with the two children listed under that. In the events table below, pointing at the guardianship event tells you which child they were guardians of. Pointing at the offspring event tells you which child they were the parents of. Just while writing this, I realized the label will be even more complicated if I remember to give the couple a marital event. Something like: "Legal guardian or mother of children (wife)".
All this is not as easy as it sounds, but historical accuracy demands it. If Treebard is going to be an example of a family-relationship structure that reflects the real world, then that is the goal, not some intermediary goal along the way. Treebard has to prove that the difficulty of doing it right is not rocket science. If I can do it, any real programmer and even a lot of amateurs can do it better. But the data structure behind this is simple. Not as simple as existing genieware, but simple nonetheless. So if a genieware creator doesn't want to try and do so much in one families table, this same data structure could be used behind any number of different GUI designs. But Treebard is where the action is right now, so:
In the progenies area, each partner has a heading where his/her kin type will be labeled, e.g. "partner", "spouse", "father of children", followed by their name.
Separating the partners from each other, there's an indented list of that partner's children with the current person. Each child's name, gender, birth date and death date are listed in a table.
Under the progenies area, an input field allows the user to enter new children for the selected partner. I haven't even started this important feature. I just realized that the only reason I haven't started the Add Child feature is that it's at the bottom. That's not a good reason. I think I'll do that part first this time, in case it's not easy.
All the person inputs in the families table are autofills, so the user can start typing and tab out when the right person fills in, or input a new name and a plus sign to add a new person, or a number sign followed by the person's ID, or any name stored for the person, such as a nickname or a membership number down at the Elks Lodge. If the name is spelled the same as an existing name in the database, a dialog will open so the user can select the right person by that name or create another one. Any of the person inputs that contain a name can be double-clicked to change the current person to the clicked person. Pointing at any of the names will open a small tooltip which will display the person ID and name type of the pointed-at name.
None of this is theoretical, it all works. Except the feature I mentioned which I haven't started. The problem is that it's so complex, and has been patched together in a series of experimental dashes for the finish line, that the result is a maze of code that can't properly be finished. It's gotten to the point where fixing one small problem creates another big or small problem. Staring at the code for hours doesn't encourage it to fix itself. Life doesn't have that many hours in it. So to save time and frustration, I will keep the GUI as is and rewrite all the code that makes it work. As usual, I'll trust that I've learned something since I started the families table, and literally delete all the logic code and rewrite it from scratch. I've already rewritten some features more than once, and tossed out other features that were redundant or supefluous. Now that I know what my goals are, it will still be hard to get this much functionality into one small table, but it won't be impossible.
What never works for me is using broken or fragile code as the model for new code. The key to my strategy, which I've used over and over, is to not even look at the old code except for very specific segments that can be plugged in to save time. Just delete it and start over, trusting that I've gained enough experience to do a lot better this time. This sounds more time-consuming, but it's not. I don't have to bang my head against a bunch of patched-together code, trying to figure out how it worked, or which part was broken, or which part was conflicting with what other part. Or how many lists & dictionaries I've created to hold the same data.
One reason this families table has gotten so discombobulated is that in order to even get this far with it, I've had to take time out to restructure older, big functionalities. Since the time, long ago, when I finally bagan the families table, I've totally rewritten the way that new color schemes are communicated to the app. Treebard is built around the user's ability to make his work easy to read and easy to look at. Fonts can be changed, and I had to do another full rewrite on that functionality. I made a huge change in the database structure which makes everything easier. So this time, when I start writing the families table logic, I'll be standing on much firmer ground and have a sort of mental map of how things should be.
The screenshots show a big complex family table scrolled to its two extreme positions. I think all this trouble is well worth it so the user can see a simple picture of a person's life with the flick of a scrollbar or mousewheel instead of clicking back and forth among several families displayed in different places. (All the names are pretty much random, just whatever popped into my mind. The final sample tree someday will be considerably more sensible.)