When you are teaching a topic (a tutorial, documentation, etc), avoid putting too much stuff in there. Stuff like error handling, best practices, etc just make what you are actually trying to teach harder to find.

If you are teaching how to do interpolation, focus your code on the interpolation, nothing else. No robust error handling. No edge case handling. No “elegant” (lol) code. This is not the right time for it. When you are writing production code, that is when you need to make it robust, readable, maintainable, and extensible.

When you are simply communicating an idea that has nothing to do with robustness or best software engineering principles, such as how to write interpolation code, or how to write multiplayer game code, just teach the frikin topic man. Adding extraneous stuff convolutes it for the reader.