I’ve been working on a new Jekyll template for lessons that can also be used to produce nicely-formatted PDFs, mostly to give myself an excuse to do a little programming every once in a while. I wanted to do the whole thing in pure GitHub Pages-compatible Jekyll without any plugins or compilation, but section references defeated me, so authors still have to run a little script to regenerate a table of contents and commit it.
And maybe that’s the difference. Dynamic function lookup can be elegant, but it imposes a higher cognitive load on someone who’s trying to figure out exactly what’s going to happen in what order, because that order is implied by control structure rather than written out explicitly. Maybe I prefer static code over dynamic code because the former is easier for the next person to understand, and I’m always coding with the next person in mind. Maybe I like dynamic teaching because I still think of it as a solo activity.