this post was submitted on 01 Dec 2023
308 points (97.8% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

I know this isn't any kind of surprise, and yet, well...

top 44 comments
sorted by: hot top controversial new old
[–] 018118055@sopuli.xyz 40 points 2 years ago (7 children)

2100 and 2400 will be a shitshow

[–] SkybreakerEngineer@lemmy.world 33 points 2 years ago (2 children)
[–] 018118055@sopuli.xyz 10 points 2 years ago

Yeah that's a different shitshow but agreed it is likely to be worse - like y2k the effects are smeared out before and after the date.

[–] borth@sh.itjust.works 0 points 2 years ago (1 children)
[–] Robmart@lemm.ee 0 points 2 years ago* (last edited 2 years ago) (1 children)

32bit systems will stop working. The Unix timestamp, which increases by 1 every second and started the first second of 1970, will reach the max of 32 bit integers. Bad things will follow.

[–] bjorney@lemmy.ca 1 points 2 years ago

This has already been patched on all 64 bit OSes though - whatever 32 bit systems are still in existence in another 15 years will just roll their dates back 50 years and add another layer of duct tape to their jerry-rigged existence

[–] Frederic@beehaw.org 16 points 2 years ago

2038 will certainly be a shit show

[–] flameguy21@lemm.ee 8 points 2 years ago

Yeah but I'll be dead so not my problem lmao

[–] deegeese@sopuli.xyz 3 points 2 years ago (1 children)

Nah.

Same thing happened in 2000 and it was a mouse’s fart.

[–] 018118055@sopuli.xyz 16 points 2 years ago (1 children)

Because of months of preparation. I know, I was doing it.

[–] deegeese@sopuli.xyz 3 points 2 years ago (1 children)

And now that every time library has been updated, we're safe until our grandchildren reimplement those bugs in a language that has not yet been invented.

[–] 018118055@sopuli.xyz 8 points 2 years ago (2 children)

I've already seen reimplementation of 2 digit dates here and there.

[–] deegeese@sopuli.xyz 5 points 2 years ago (1 children)
[–] 018118055@sopuli.xyz 4 points 2 years ago (1 children)

Fortunately I will not be involved. Hopefully I can make something from 2038 though.

[–] deegeese@sopuli.xyz 2 points 2 years ago

You’re not the only one forseeing a nice consultant payday there.

[–] JustCopyingOthers@lemmy.ml 3 points 2 years ago

I went to uni in the mid 90s when Y2K prep was all the rage, went back to do another degree 20 years later. It was interesting to see the graffiti in the CS toilets. Two digits up to about 1996, four digits for a decade, then back to two.

[–] Midnight1938@reddthat.com 3 points 2 years ago (1 children)
[–] 018118055@sopuli.xyz 16 points 2 years ago (1 children)

2100 not a leap year (divisible by 100). 2400 is a leap year (divisible by 400). Developing for dates is a minefield.

[–] Midnight1938@reddthat.com 1 points 2 years ago* (last edited 2 years ago)

Now imagine working on non Georgian, and the year is 2060

[–] 0x4E4F 3 points 2 years ago

Luckily, none of us will be there.

[–] humorlessrepost@lemmy.world 1 points 2 years ago (1 children)

Won’t the computer’s clock reset every time you go to sleep and stop cranking the power generator?

[–] 018118055@sopuli.xyz 3 points 2 years ago

Yeah who knows if our computers are sticks by either date

[–] accidentalloris@lemmy.world 39 points 2 years ago (1 children)

Then there's my code, which didn't even survive the time change.

[–] ultratiem@lemmy.ca 3 points 2 years ago (1 children)

Your code made it to the time change!!?

[–] agent_flounder@lemmy.world 4 points 2 years ago

Same... The change from 12 to 1

[–] TootSweet@lemmy.world 17 points 2 years ago* (last edited 2 years ago)

People who haven't had a birthday in almost four years are like

reaction gif of a little boy busting out a funny celebratory dance in the stands of (probably) an unknown sports event.

[–] DieguiTux8623@feddit.it 12 points 2 years ago (1 children)

Programming aside, where I live in Southern Europe we have a tradition according to which leap years bring bad luck. After 2020, I don't know what to expect... nuclear apocalypse maybe?

[–] Alexstarfire@lemmy.world -1 points 2 years ago (1 children)

Wait, 2020 wasn't a bad luck year?

[–] Land_Strider@lemmy.world 7 points 2 years ago* (last edited 2 years ago)

Previous commenter meant "what could be worse than the bad luck leap year 2020?"

[–] Synthead@lemmy.world 9 points 2 years ago (1 children)

Always, always, always, without taking any shortcuts, use a tzinfo library for your language.

[–] milkjug@lemmy.wildfyre.dev 3 points 2 years ago

Anyone who doesn't use standardized libraries for tz should be summarily tried.

[–] Bishma@discuss.tchncs.de 7 points 2 years ago (1 children)

I'm not worried about my code, I'm (very slightly) worried about all the date libraries I used because I didn't want code that shit again for the billionth time.

[–] perishthethought@lemm.ee 7 points 2 years ago (1 children)

Your comment made me go look at the source for moment.js. It has "leap" 13 times and the code looks correct. I assume they test stuff like this.

[–] Bishma@discuss.tchncs.de 4 points 2 years ago (1 children)

Yeah, I'm generally using the common data/time libraries in most (if not all) languages and I'm pretty sure they've all been through more than 1 leap year at this point. I just never 100% trust the code I don't control - 99.9% maybe, but never 100.

[–] lightnegative@lemmy.world 3 points 2 years ago

I just never 100% trust the code I don't control

I never 100% trust the code I do control. Partially because a lot of it is inherited but also because I know corners were cut but I can't always remember when and where

[–] Frederic@beehaw.org 7 points 2 years ago (1 children)

I worked in broadcasting (programming broadcasting applications), everything is done with PTP (Precise Time Protocol) and TC (timecode) in video. We had to support leap second, it's not as easy, but in the end, insert black frames for 1s and that's it.

[–] TostiHawaii@feddit.nl 4 points 2 years ago (2 children)

I hope leap days are handled a bit more sophisticated!

[–] Scrollone@feddit.it 6 points 2 years ago

Insert black frames for 24 hours and you're good to go!

[–] Frederic@beehaw.org 2 points 2 years ago

Haha yes, no problem with those 😁

[–] DmMacniel@feddit.de 4 points 2 years ago (1 children)

Yeah... I patched some unit tests...

[–] killeronthecorner@lemmy.world 3 points 2 years ago

Before it was 50/50 that they'd fail on leap day, but after the patch it's 50/50.

[–] KISSmyOS@lemmy.world 4 points 2 years ago* (last edited 2 years ago)
[–] superweeniehutjrs@lemmy.world 2 points 2 years ago

I hope the homeassistant guys already have this covered, because I didn't use it 4 years ago to know

[–] rolaulten@startrek.website 1 points 2 years ago* (last edited 2 years ago)

We found an use case with Page duty and it's ical feed already...