← Back to context

Comment by LtdJorge

3 days ago

The Date API is horrible

Yea, that's understood to be the opinion, blandly repeating it adds little to the discussion.

It's simple. In it's simplicity it left many features on the floor. I just can't connect with the idea that someone would need to constantly be on MDN in order to work with it. It's not so horrible that it defies logic.

  • It’s not simple, though. Simple would be something like an object wrapping YYYY-MM-DD, like a COBOL programmer in the 1950s would’ve used. Instead, people have made thousands of variations of bugs around the complexity even basic usage forces you to internalize like the month number being zero-based while the year is 1900-based but the day of the month is 1-based following standard usage.

  • It's not simple, it has hidden pitfalls and footguns. Using it is the fastest way to blood on the floor (to quote a senior developer I worked with).