Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The need for backwards compatibility is what is keeping JavaScript still not a great language. The number of wtfs and surprising behaviour is justified by needing to conform to what the language already did, and that is not a good thing.


I think the combination of introducing new features in a non-overlapping way with the ones they replace, and the use of linters to prevent you from using the old ones, is a pretty good way to improve the language without being affected by backwards compatibility.


Which wtfs bite you the most?

I can't remember being bitten lately, maybe I have a blind spot.


In a lot of the places where NaN is generated, I would prefer it if an error was thrown.


I think all JS NaNs are quiet NaNs when sometimes signaling NaNs should be supported/be preferable https://en.wikipedia.org/wiki/NaN#Signaling_NaN


forEach returns undefined. Why would you not just return the same array for easy chaining?


Probably to make a distinction between map() which returns a new array. If forEach returned the same array I believe you'd would see a lot more bugs.


They should do something like Python. Python 3 is loads better than Python 2. It removes legacy cruft at all levels cleaning it up completely. It even made Python 2.7 a backwards compatible language in which you can write code that with minimal modifications can be just moved to a Python 3 version. (Using modules like future)


Except upgrading to Python 3 on your application server is pretty trivial to do.

There are too many client vendors and devices for this to work. And even with the new features in ES2015, almost everyone actually using them is still using Babel to support older browsers.


I think it could work. Are there any reason for this not to be implemented?


No BDFL or authority to tell detractors to screw off. Breaking backward compatibility is kinda a big thing in the web because most of the web is still running legacy stuff.

These kind of things don't happen without such a person or group who will arbitrarily make decisions. The same reason why better languages like Dart don't get adopted.


Yay, typeof null.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: