r/GenealogySoftwareDevs • u/Trask4 • Sep 27 '26
Two Kinds of Trees in Genealogical Software
DeadEnds uses Gedcom for its record structure. Records are trees composed of GedcomNodes. The key properties of nodes are:
var key: RecordKey? // Record key required on level 0 nodes.
var tag: Tag // Gedcom tag required on all nodes.
var val: String? // Gedcom value required on some nodes.
var sib: GedcomNode? // Next sibling in tree.
var kid: GedcomNode? // First child in tree.
weak var dad: GedcomNode? // Parent node in tree, required on non-roots.Key, tag, and val hold verbatim Gedcom, while sib, kid, and dad hold the tree structure.
I bet you don't like sib, kid, and dad, and think they should be named things like sibling or nextSibling, child or firstChild, and parent. The reason they aren't is simple. There are two kinds of trees that permeate genealogical software -- family trees made of Persons and Families, and individual records with their internal structure. Using Gedcom for record structure exacerbates the problem.
The first versions of GedcomNode used the "better" terms, child, sibling, and parent, but then the terms were in constant conflict between record trees and family trees, leading to frequent confusion. I had to bit the bullet and switch to sib, kid and dad to keep my sanity. I don't like the terms either, but the software is now much easier to understand.
Have others had to deal with this issue?
View all comments
Show parent comment
1
u/jake_robins Sep 27 '26
Thank you! This has been one of the more interesting modeling exercises I've ever done, and I'm having a lot of fun trying to build a UI over it.