2 ms·
Since when using a standard library became "rolling your own code"?
by xfer 8y ago
Since when using a standard library became "rolling your own code"?
- detaro 8y agoI read it as "use abstractions over the (problematic) standard library, and ideally don't roll those yourself".
- peterwwillis 8y ago"Standard" does not mean "universally compatible". It means "standard", as in, something an authority or custom has established as a model or example. Gather together every "standard" system call you can find and run unit tests on them on multiple platforms and you will discover they don't always return the same results. "Using a standard library" is a form of "rolling your own code" when the thing you want to do is non-trivial. Sometimes it's hard to know if what you're doing is non-trivial, but certain things should be a given. Dates and times are non-trivial. IPC is non-trivial. Memory management is non-trivial. Sure, you can call malloc() and free() yourself, but it's really not that hard to screw them up. Same for dates and times: they are more difficult than they appear. This is part of why people write things like date libraries, to work around portability problems and provide what you actually want. In this case it's not so much a portability problem as a problem in understanding what you want to do and how best to do it.