Sheet Music vs. FP
2025-05-31
Sheet music specifies control flow in more ways than FP does.
FP restricts control flow to sequential line-by-line stepping and blocking on function calls, which are themselves just recipes of sequential line-by-line stepping - essentially dynamic macros that effectively expand into sequential, line-by-line stepping within the calling function without locality-of-reference / predictability of how many levels of expansion (calling) might be involved.
FP decomposes computation into small, ultra-normalized steps, but, complicates understanding - by normal humans - in doing so, by using infinite regress.
Sheet music specifies time signature, event-beginning and duration (relative to time signature), repeat and GOTO (coda). Sheet music notation covers all of that in a way that is sufficiently simple for 5 year olds to grok.
FP deals with for-loops on numbers, while sheet music deals with loops of higher-level concepts, like whole chunks of music.
What is for(...){...}? What is mapping (mapcar, etc.)? What is list comprehension? All of this stuff is just iterative control flow elided as syntax and functions.
Essentially, mapping is too cumbersome to express in FP notation, so we just elide it as functions.
What is Lambda Notation? It’s atomic elements of programs, but, it’s a horrible UX for normal humans. Normal humans don't want to think in terms of atoms, they want to think in terms of molecules, or the composition of molecules, say, stuff like Saran Wrap®.
Sheet music’s time signature scopes hard-realtime control flow, while FP only scopes memory mutation.
UNIX pipelines and processes scope control flow.
StateCharts scope control flow.
As far as control flow goes, class-based inheritance is inappropriate, while Parental Authority is more appropriate.
Appendix - Sheet Music vs. FP
See Also
Email: ptcomputingsimplicity@gmail.com
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: guitarvydas.github.io
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/65YZUh6Jpq
Leanpub: [WIP] https://leanpub.com/u/paul-tarvydas
Gumroad: tarvydas.gumroad.com
Twitter: @paul_tarvydas
Substack: paultarvydas.substack.com

