From the official Ruby DateTime docs:
> If you also have to deal with timezones then best of luck - just bear in mind that you'll probably be dealing with local solar times, since it wasn't until the 19th century that the introduction of the railways necessitated the need for Standard Time and eventually timezones.
Friends don't let friends use time zones
There also appear to be.... no unit tests for timezones in Rubylang??? Am I reading this right? They haven't even been touched in ~3 years and most of them are placeholder
https://github.com/ruby/ruby/tree/master/spec/ruby/library/datetime
Normally I'm not a stickler for 100% test coverage but...... this is a stdlib in Ruby? The programming language?
Wait I stand corrected! There are some tests, they are in Time and not DateTime. But also the ruby docs point out that there are actual differences between the two if you are calculating historical time
@darius *looks at the pile of bugs we've had to fix in our own application that ended up being because of ruby timezone bullshit*: yea, that makes sense
@darius timezones! Who needs 'em? 🙃
[I don't always test but when I do I test in production.jpg]
@darius@friend.camp If you'd like, you could probably land a blog post about it on HN, which would direct a lot of eyeballs and maybe a single digit number of handballs to those unit tests
@michcio I followed up, there are tests for timezone codes after all but not *historical* tests
@darius
An … entertaining subject to say the least:
https://github.com/kdeldycke/awesome-falsehood#dates-and-time
@RyunoKi I'm scared to read this https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
@darius
Do you have a concrete example that kicked this research of for you?
When you study Ruby's code, perhaps use git blame to check for last change and jump from the commit to a PR to gather more context. Might have a good reason why they didn't invest more effort into this part of the codebase.
@RyunoKi the history of basically all the tests are all clobbered by this commit -- it seems like they haven't really been touched in well over 5 years, I'd have to go back to some previous repository in order to find relevant commits
@darius
Jay… ._.
@craigmaloney
Actually, pytz is an amazing piece of software :-)
@darius
@darius @RyunoKi using NodaTime (the library used as a reference in this post) completely changed my perspective on working with datetimes and also now makes me very angry about every language's datetime stdlib which all seemed designed to maximize footguns.
The end result is programmers learn "datetimes are scary" instead of "this stdlib sucks"
@clarity
We know since https://xkcd.com/1883/ that they're scary 🙃
@darius
@RyunoKi @darius first off: how is there so much??
second, I've only read two (So You Want to Abolish Time Zones and The Long, Painful History of Time (repeatedly))
and finally, for people who are into the history of time, i highly recommend “Why isn’t the new year on the winter solstice?”
@darius w t f
Oh well, another day, another data point in favor of "the fact that computers run at all is a miracle"