Patterns Emerging

The Fishbowl: Mini-Pattern: The File / Stream Duality

If you are writing an API that takes a filename, instead provide an API that does precisely the same thing to an arbitrary stream of bytes, and then add “convenience” methods that apply those stream-based methods to files.

and if only to make your system configurable to whoever wants to use it 🙂 I have encountered this one early on in my “programming career”

By Yashima

Writer of code and stories