Is there a schematic table editor? (@jonathoda?) I’ve been writing complicated nested conditionals in non-Subtext languages and frequently transcribing them as schematic tables in spreadsheets to understand and refactor them—but man, is it tedious!
10/06/2023, 10:55 PM
That’s interesting. I’ve always wanted to integrate those ideas into my subsequent work but it never fit. Maybe someday…
I’d love to see how you model conditionals in a spreadsheet.
10/07/2023, 12:56 AM
Here's a recent one. It's from a function that determines the state to transition to in a state machine.
The C code had grown organically for a while and I noticed some duplicated branches, so I converted it to a spreadsheet approximation of a schematic table to be able to see which transitions I could dispatch most easily (like column B and C, then F, because they depend on the fewest values / have the most blank cells). I moved those branches up front in the C code.
It helped me simplify the function in the way that I wanted without any existing tests failing, and (surprise) found a bug that I added a new test case to cover. I don't think I could have done that if I'd only worked with the C code (because I tried and failed 😅).
I remember now that I had to reorder the rows a few times before the structure fell out nicely. If I put "is_active" below the two classifications, for example, then things doing coalesce as well because I'm laying the table out by hand.
10/09/2023, 5:15 PM
@alltom Nice. Back when I did Schematic Tables there were some tools that made Decision Tables. No idea if they still exist