Hacker News new | ask | show | jobs
by spfzero 1474 days ago
He's not comparing quality, as much as quantity. Building a small utility function, general enough for your intended use, brings in less code than adding a library dependency. That's the argument.

TLS is an example of when you probably would not make that trade-off, but there are lots of other examples where it would make sense.

1 comments

Sure, but the parent post is about logging - which isn't a small utility function. `printf` works for scripts up until it doesn't. When you start needing structured logging, log levels and you are debugging performance issues because of logging you start to understand why that complexity is put in place. Leftpad? Sure that's extraneous. But logging?