back

by porridgeraisin·1y ago·view on hn ↗
But if you have two modes of operation:

- Reading in memory data

- Reading from a stream

Then whats wrong with having two different APIs to use each mode?

Instead of you doing a if (detect in memory) in your code, it's just two different functions.

1 comments
Nothing. Or next to nothing at worst.

It would just be nice if it could automatically do the best thing.