4 ms·
> date.getFullYear() => 2025 `getYear` is literally deprecated everywhere and is not part of the spec. https://tc39.es/ecma262/multipage/numbers-and-dates.htm
by wiseowise 1y ago
> date.getFullYear() => 2025
`getYear` is literally deprecated everywhere and is not part of the spec.
https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.prototype.getfullyear https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec...
- jameshart 1y agoRight, but it exists and looks correct and runs and won’t trigger any kind of error if you write code that uses it. This is what we call a ‘foot gun’.
- hombre_fatal 1y agoOn the other hand, you notice it the second you go use the software you just wrote to ensure it works. So it’s more like a foot dollar store water gun.
- const_cast 1y agoNo, it's a proper footgun, same as dereferencing a nullptr in C++. You'll notice that too - doesn't mean it's not a footgun. And, in fact, most C++ compilers today will actually warn you when you derefernence a nullptr in a stupid, obvious way. Evidently, JS has not caught up to this incredibly sophisticated technology /s.
- jameshart 1y agoJS has caught up - it has a sophisticated compilation and linting ecosystem called ‘TypeScript’. Which at least will tell you you’re using a deprecated API, but won’t overcome the dumb API naming choices JavaScript blindly imported from Java
- const_cast 1y agoWe've come full circle. The build systems for JS, a scripting language, make C++ compilation look trivial. And, unfortunately, that's reflected in the compile times.