3 ms·
>I'm not sure when programmers became so averse to writing simple code. I know everyone likes to spend a day writing a date/time library, but when you need to
by robertAngst 8y ago
>I'm not sure when programmers became so averse to writing simple code.
I know everyone likes to spend a day writing a date/time library, but when you need to develop a full stack app. You just dont have time to do everything from scratch.
These are decisions you have to make.
- paulddraper 8y ago> date/time library > leftpad Yes, there is a difference between these.
- dsr_ 8y agoThere's also a difference between "we have a dependency on this versioned library that we have archived and deployed" and "we have a dependency on this library which we refer to dynamically at run-time". But the second one gets you closer to the mythical perfection called "serverless" because it uses so many different servers you can't keep track of them all.
- zaarn 8y agoLeftpad isn't complex. It just adds spaces. Datetime libraries are complex because they need to do things like deal with the fact that North Korea switched Timezones last year, that Fiji is changing their DST dates this year and other crap. We get about 3 to 10 releases of the TZ database every year and you'll probably want the updates as quickly as possible in your Datetime library to deal with timezoned data correctly, otherwise your Customer from Fiji will find that you aren't turning up for the meeting because you left an hour earlier believing the customer wasn't turning up at all. And then you have to deal with dates in the past where there might be possible changes to the entire calendar! Or different calendars such as the Japenese, Chinese or Jewish years. I don't think it's valid to suggest that leftpad and datetime libraries are even on the same order of magnitude of engineering complexity.
- zerotolerance 8y agoWouldn't advocate for total DIY. I recommend leveraging third-party libs and infra especially during experimentation or to buy increased development speed. Just calling out that those are long-term liabilities, and that when appropriate that tech debt should be paid down by writing code that you can control.