5 ms·
My sentiment here is that modern JavaScript is _much_ better than its predecessors. The real issue, as it pertains to the web browser, is supporting legacy func
by mrskitch 9y ago
My sentiment here is that modern JavaScript is _much_ better than its predecessors. The real issue, as it pertains to the web browser, is supporting legacy functionality that's causing drag on the web as a whole.
I'm curious: what's so bad about JavaScript that other languages seem to do better?
- mplewis 9y agoThe type system and standard library.
- scottmf 9y agoThe standard library is improving a lot.
- nostalgeek 9y ago> The standard library is improving a lot. Javascript has next to no standard lib, actually. Let's not forget that the DOM or WebAPI are not part of ECMAScript spec.
- scottmf 9y agoWhat do you think it needs?
- cpburns2009 9y agoThe implicit type coercion of JavaScript is terrible, the single-inheritance prototype system is awful, lack of integer types, and undefined.
- azeirah 9y agoNaN is the ultimate horror within JavaScript's type system. Other than that, you're spot-on.
- merb 9y agoor undefined and null. I mean most languages have "problems" with null, but JS basically has two "problems".
- gsnedders 9y agoNaN behaves as it does in any other language with IEEE 754 floats (the behaviour of NaN simply comes from IEEE 754), which is most…?
- dragonwriter 9y ago> NaN behaves as it does in any other language with IEEE 754 floats Yes, but most other languages don't use IEEE 754 binsry floating point as their only numeric type. Or even their primary one.
- cpburns2009 9y agoWhile I dislike NaN and would much rather prefer an exception to be thrown, I can accept NaNs existence because it's at least part of the IEEE 754 standard. It still bugs me that `NaN != NaN`, and JavaScript's type coersions make NaN worse because it seems like they randomly popup.
- ng12 9y agoHow many times have NaN semantics actually broken your code? My guess is never.
- ChrisSD 9y agoSingle inheritance prototype system is actually something I like about js. I'm wondering why you consider it awful?
- cpburns2009 9y agoIt's too ad-hoc and over-complicated to implement common things such as classes and interfaces. In JavaScript you're essentially stuck with stringly typed values and chaining mix-ins together to emulate a class hierarchy. It's also difficult to get instanceof to work as one would expect. The other languages I'm used to all natively support it: Python and Java. Granted, Java is single-inheritance too but you can implement multiple interfaces.
- ChrisSD 9y agoAh yes if you're thinking in terms of classes then that would be frustrating.
- WhatNotAboutism 9y agoEven with the most ubiquitous language in the world using prototypical inheritance, the average (mean) programmer prefers to imagine and express themselves in an inheritance based system. At some point, everyone will have to accept that prototypical approach is fine for some, but less productive over time for the world.
- tobltobs 9y agoJavascripts handling of asynchronous operations.
- scottmf 9y agoWhat’s wrong with that exactly?
- thsowers 9y agoI miss true integers! And literally almost every other type. I'm looking forward to trying out typescript, but it would be nice if this was a part of the pure language itself
- tboyd47 9y agoNo standard library hurt for a long time.
- ben-schaaf 9y agoIt still doesn't have integers.
- deleted 9y ago[deleted]
- daxterspeed 9y agoNot having numeric types is a real issue - but on the plus side BigInt is advancing quickly https://github.com/tc39/proposal-bigint https://github.com/tc39/proposal-bigint
- cuspycode 9y agoAgreed. The fact that JavaScript lacks reasonable numeric types means that I never use it except when there is no alternative.