4 ms·
Imagine you are shipping a library. Say, one that tells you about timezones. You want your users to just be able to import that library and use it. The fact
by mcpherrinm 6y ago
Imagine you are shipping a library. Say, one that tells you about timezones.
You want your users to just be able to import that library and use it. The fact that you need a bunch of zone info files should be invisible to them.
Maybe those users are in a sandboxed environment that doesn't allow opening files, or you're in webassembly where files don't exist.
It's much simpler to just bake that data into the library.
- DaiPlusPlus 6y agoI’d prefer a library that uses the IANA tzdb directly - so I can download the latest tzdb files for my application and OS without needing to wait for the maintainer of that library to ship an update.
- elcomet 6y agoYou missed the point. This is not about timezones, but about the need that sometimes happen to embed files into a library. Parent just chose timezones as an example.
- malandrew 6y agoThey used time zones to illustrate a point. Of course it’s generally best to use that file instead for that specific use case. Now imagine some data that isn’t shipped with Linux by default. That’s the point they were trying to make.