118
submitted 1 day ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 48 points 1 day ago

JavaScript Date objects are cursed

JavaScript date objects are 1 indexed for years and days, but 0 indexed for months.

Oh that's not nearly the only thing javascript fucks up about their Date() implementation. https://jsdate.wtf/

[-] [email protected] 13 points 1 day ago

I ... this seems like a std library made to troll you. Is there a (good) reason it is like that?

[-] [email protected] 6 points 11 hours ago

Backward compatibility and not seeing the future. Some decisions are taken at one point in time, then a new use case show up, then a new paradigm evolve, then… etc etc.

It's really the same thing that holds back a lot of languages and libraries. And even when replacement shows up, old habits from devs and old projects maintenance keep all these things well alive too.

[-] [email protected] 6 points 18 hours ago

early js/html liked to do something in all cases instead of throwing or whatever. I think it's mostly just a collection of them trying to do something smart on nonsense input and not being consistent about it.

side note, I'm so excited for Temporal, some browsers already support it and you can polyfill for the rest.

[-] [email protected] 2 points 20 hours ago

I can only imagine it wasn't planned properly, cuz that's so many quiet behaviours without good parsing errors

this post was submitted on 18 Jul 2025
118 points (97.6% liked)

Programming

21634 readers
319 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS