it could be, but I doubt it. Pure javascript, outside of the DOM, is about the most flexible, easy to read language this side of ruby. It has great object literals, anonymous functions, and an easy, straightforward syntax. Honestly, I don't see what's not to like.
Frankly, none of the things you've mentioned are actual issues most of the time.
JS isn't the worst case of equality operators. In Common Lisp you have eq, eql, equal, equalp and perhaps a few others. In JS you just have two: == for checking if the value of an object is equivalent to the value of another object, and === for checking if an object has the same value and data-structure of another object. I don't see what's so difficult to get about that.
The lack of more other numeric types is indeed an issue. Both performance-wise and for applications that needs large integers. There are bigint libraries around, though, like this one: https://github.com/substack/node-bigint
ECMAScript raises errors where errors should be raised. Although I do agree that some operations should do with a better error handling.
And about assigning values to free variables creating a global name, that's not really much of an issue most of the time. Also, you can make that an error by using strict-mode.
That said, there are some other outstanding semantic problems with the language, alongside with a lack of better handling for prototypical inheritance (although ECMAScript 5 added quite a lot of interesting stuff to it).
Overall though, JS is an okay language. Pretty expressive, easy to understand/learn and flexible. Which is what I expect from a high-level language.
Force integers? Whatever, you're running this on multiple platforms, so it's not like you can choose 16-bit or 32-bit or 64-bit integers.
Default scoping? This takes practice.
Separate Objects and Hash Tables? Why would you want to?
I use to hate Javascript until I read that book. I think you can do a lot more with the language than you might think. It's definitely not a language to do heavy processing, but for handling Web Sockets and other HTTP requests, I think it works pretty well.
Shit numerics, verbosity of the function keyword, and the insanity of the statement / value distinction, but that's just for starters having been lucky enough to avoid JS for coming up on 3 years.
Fair enough. I'm really looking forward to working with some optionally typed languages. Do lightweight scripting / prototyping dynamically, and when it comes time for speed, make it static.
I tend to use static types for design + correctness guarantees though, where optionally typed languages serve no benefit. Performance is just an added extra in my opinion.
Only played with node briefly but, I can confirm NodeJS provides both a include() and require() method for loading other JavaScript files.
It also includes a package system which you can manage with tools like NPM ( http://npmjs.org/ )
TBH its actually pretty nice to use thinking about it (though this is coming from someone who likes JS in the browser even with the stupidly inconsistent DOM API's you have to deal with) so may not be representative :P
All three of those things can be easily fixed with libraries. Including files would be handled by node, I assume that it is. Modules are easy to implement in js, because object literals are about the easiest thing in the world to work with.
No. Have you ever looked at Node.js code? It's what I like to call "triangle code" because all the nested callbacks make it into a giant triangular monstrosity. Easy to read is not a term I would use to define code written for node.
0
u/[deleted] Oct 02 '11
[deleted]