3 ms·
The global io trick would totally be valid if you’re writing an application (i.e. not a library) and don’t have use of two different implementations of io
by ismailmaj 1y ago
The global io trick would totally be valid if you’re writing an application (i.e. not a library) and don’t have use of two different implementations of io
- throwawaymaths 1y agoyou could still have a library-global io, let the user set it as desired. > use of two different implementations of io functionally rare situation.
- laserbeam 1y agoThere are plenty of libraries out there which require users to do an init() call of some sorts at startup. It is perfectly possible to design a library that only works with 1 io instance and gets it at init(). Whether people like or want that… I have no clue.