3 ms·
This is why people shouldn't write their own time functions (in the same vein as not writing their own encryption code). If it's not used in a public library by
by johnklos 4y ago
This is why people shouldn't write their own time functions (in the same vein as not writing their own encryption code). If it's not used in a public library by many, many other things, issues like these might not be discovered until it's too late, or until Rachel discovers them (but Rachel can't be expected to check all the things).
- aftbit 4y agoBy extension of that logic, engineers basically shouldn't write anything except very high level application glue code, and only that as a last resort. Rely on libraries made by people who are domain experts or at least have a lot of eyeballs and users, because _every_ problem domain has a lot of ugly warts and major issues. People warn about time and encryption specifically because these issues can be subtle and take years to be exposed, but the same is true for lots of others as well. Don't write your own parsers, network libraries, locking primitives, data structures, filesystems, databases, etc. Except of course, sometimes you have to.
- xboxnolifes 4y agoThe insight is to not write critical, bug prone code if you don't have to. Encryption, time, primitives, etc., are things that many people need and use and already exist. If the solution you need doesn't already exist, of course you need to write your own.