Finding a better, simpler approach with less code required is a wonderful feeling.
Related Posts
I'm intrigued to see that Google has quantified that new code is generally buggier and less secure than code that has existed in your codebase for longer: https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html
Over a sufficiently long time horizon, all code you write is legacy code.
Go has an elegant approach to defining example functions, which are shown in docs as `main()` with the output: https://go.dev/blog/examples