this post was submitted on 03 Apr 2024
39 points (100.0% liked)

Programmer Humor

19154 readers
2012 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 7 points 5 months ago (23 children)

I'm ok with timezones, but the guy who invented daylight savings time I'd slap to all the way to the sun

[–] [email protected] 2 points 5 months ago (7 children)

From a development perspective it certainly sounds easier to have one global timezone with DST than a bunch of smaller ones without it. Would that make sense in reality? Probably not but I definitely think timezones take more work to compensate for properly.

[–] [email protected] 3 points 5 months ago* (last edited 5 months ago)

Not really. Timezones, at their core (so without DST or any other special rules), are just a constant offset that you can very easily translate back and forth between, that's trivial as long as you remember to do it. Having lots of them doesn't really make anything harder, as long as you can look them up somewhere. DST, leap seconds, etc., make shit complicated, because they bend, break, or overlap a single timeline to the point where suddenly you have points in time that happen twice, or that never happen, or where time runs faster or slower for a bit. That is incredibly hard to deal with consistently, much more so that just switching a simple offset you're operating within.

[–] [email protected] 2 points 5 months ago (2 children)

What matters is consistency and our time system has tons of crazy inconsistent shit in our. Everyone knows about leap years, but do you know about leap seconds? Imagine trying to write a function to convert unix time to a current date and suddenly all your times are a second off.

Just look at this insane bullshit nonsense. The added complexity of time zones and daylight saving time is nothing compared to simply supporting our time system.

load more comments (2 replies)
load more comments (5 replies)
[–] [email protected] 1 points 5 months ago (1 children)

Switching sucks but DST is better than Standard Time.

[–] [email protected] 1 points 5 months ago* (last edited 5 months ago) (3 children)

Which part of the year is DST and which part is Standard Time?

I know, but it seems like half the people that say they prefer DST have it backwards.

[–] [email protected] 2 points 5 months ago (10 children)

It's easy, the good part is DST (which is what we're currently in - Spring through Fall in the northern hemisphere).

load more comments (10 replies)
load more comments (2 replies)
load more comments (21 replies)
[–] [email protected] 5 points 5 months ago (1 children)
[–] [email protected] 4 points 5 months ago (13 children)

Worked on a project where devices just magically froze, but only during the month of February!

Turned out the people who had written the firmware had decided to do their own time math to save space and had put in an exception in the code for leap year values. Except instead of February 29th, it kicked in for the whole month. And the math was wrong so you ended up with negative values.

The product was due for launch in March of that year and was headed to manufacturing. It was by sheer luck that someone ran a test on February 1st and caught the problem.

Don't mess with time in code, kids.

load more comments (13 replies)
[–] [email protected] 2 points 5 months ago (6 children)

The UK press every year makes a huge song and dance in opinion pieces about getting rid of DST. However I'm always horrified to see that people want us to keep British Summer Time instead of Grenwich Mean Time. I understand that there are "longer evenings" in BST; however we literally invented GMT and coerced the rest of the world to adjust their times based on that. From the point of view of being constantly compatible with UTC and having more consistent business hours for international companies it makes more sense to me if we kept GMT.

Also the longer evenings thing can be achieved by simply staying up an hour later. It's not exactly like an hour is being stolen from you when the times switch, the change of clocks are mainly pointless admin.

Lastly I read an article recently that described a correlation between the incidence of heart attacks and the clocks changing. The theory is that just slightly messing with people's sleeping patterns can cause additional strain on the body.

[–] [email protected] 2 points 5 months ago

Another point for GMT, in the mid '70s, the US went onto DST year round for a couple years. People hated it so much they changed back to switching the time.

If we wanna do away with DST and BST, we need to go back to standard time, as the later sunset in the summer translates to no sunlight for workers in the winter

load more comments (5 replies)
[–] [email protected] 1 points 5 months ago

But if time travel is a thing, imagine the whole new time nightmares! Oh you went back a year with your phone? Now all your TLS root certs are invalid because you're before the start date. Or you have files/emails/whatever that are dated in the future. I guess you can get to that state by just setting your clock forward but I imagine some stuff would break.

[–] [email protected] 1 points 5 months ago (1 children)

I feel you're conflating TimeZones with ever-changing Daylight Savings time rules.

[–] [email protected] 1 points 5 months ago (1 children)

True but so do most computers. Computers have a database of timezones and time offsets around the world. Depending on the UTC date and time, and your current timezone it will look up what offset to apply to show the local time. The database is very gnarly since rules change over time, e.g. maybe in the 70s some countries had longer DST to counteract oil shortages.

[–] [email protected] 1 points 5 months ago
[–] [email protected] 1 points 5 months ago* (last edited 5 months ago) (17 children)

Cool, so sunrise is at 8 PM now. Or maybe there's just no consistent relationship between what a clock on the East and West coast of America say, and a call can't be scheduled between them.

The real problem with time and date is that it has to fit social and natural systems as well as actual passage of time. A lot of nuance is unavoidable.

[–] [email protected] 1 points 5 months ago

Yes! Very much so.

This is a good illustration of exactly why timezones exist and the issues with not having them.

load more comments (16 replies)
[–] [email protected] 1 points 5 months ago* (last edited 5 months ago) (8 children)

I've just said 'fuck it' and switched all my clocks to UTC. I don't even care anymore.

load more comments (8 replies)
[–] [email protected] 1 points 5 months ago

The guy that invented time zones was solving a problem where each little town had their own time standard. I don't think that was sustainable.

[–] [email protected] 1 points 5 months ago

I used to feel this way. Over the course of building out 2 calendar systems in my career (so far) and having to learn the intricacies of date and time-related data types and how they interact with time zones, I don’t have much disdain for time zones. I’d suggest for anyone who feels the same way as this meme read So You Want To Abolish Time Zones.

Also, programmers tend to get frustrated with time zones when they run into bugs around time zone conversion. This is almost always due to the code being written in a way that disregards the existence of times zones until it’s needed and then tacks on the time zone handling as an afterthought.

If any code that deals with time takes the full complexities of time zones into account from the get-go (which isn’t that hard to do), then it’s pretty straightforward to manage.

[–] [email protected] 1 points 5 months ago (2 children)

Soon we're going to have a new timezone for the moon. Yay, I guess?

[–] [email protected] 1 points 5 months ago (4 children)

Surely they will just use utc?

load more comments (4 replies)
load more comments (1 replies)
load more comments
view more: next ›