3 ms·
This is a nice little article. But I have a different perspective on a number of these issues. My thoughts: > 1) There is no integer type! Yup, problem. See a
by ggchappell 11y ago
This is a nice little article. But I have a different perspective on a number of these issues. My thoughts:
> 1) There is no integer type!
Yup, problem. See also Lua. [I suppose in JS one could create a typed array and use the items as integer-typed variables (?). But who wants to do that?]
> 2) JavaScript’s loose typing and aggressive coercions exhibit odd behaviour.
I call this a non-issue. If a give-me-this-object function has the possibility of failure, then it should return a truthy value on success and a falsy value on failure. But in all other circumstances, just avoid the implicit type conversions.
> 3) Automatic semicolon insertion.
Yeah, it was tried in JS and in Go. I think it turned out to be a bad idea in both cases. Let's not build it into any more PLs, okay?
> 4) JavaScript is seriously abused.
Not a problem with JavaScript.
There are many idiots in the world. Try not to let them ruin your day.
> 5) JavaScript is highly dependent on global variables.
I think this is a problem with common JavaScript APIs, not JavaScript per se. But, yes, it is a problem.
> 6) JavaScript code can fail silently due to syntactical slip-ups.
Yes, that's annoying.
> 7) Prototype objects do not scale well to large applications.
Hmmm ... no explanation. I'm not sure exactly what the issue is. But then I've never written any large-scale JS code based on a hardcore OO design philosophy.
And later:
> ... [ES6] classes are not as completely fleshed out as you would find in Smalltalk and C++, for example.
The "completely fleshed out" classes in C++ are insanely complicated, with whole books covering their details & pitfalls. Let's not go there. And the Smalltalk OO model has been largely abandoned for years -- perhaps for good reason?
> 8) Asynchronous programming in JavaScript is very messy.
Sure, but I think of this as more of a challenge. We're really just learning the ins & outs of large-scale asynchronous code. I look forward to seeing how JS and other PLs evolve to handle these issues.
> 9) ... Lisp is a wonderful language and by extension, so is JavaScript. But JavaScript is nothing like Lisp!
Is this a problem?
> 10) The main draw of JavaScript is actually in frameworks like Node.js and AngularJS. If not for them, why would you use JavaScript???
Because it's the only PL with native support in all major web browsers?
- horrido 11y ago9) Not a problem, per se, but it's the expectation that JS is a great language. This erroneous belief is misleading and dangerous, drawing in people who don't know any better. 10) As I said, while you can't get JS out of the web browsers, you can transpile to it as an assembly language. That was my main point.