The Achilles Heel of JavaScript is its inconsistent behavior across implementations. It is virtually impossible to use it to do anything robust on the client side.
JavaScript is weakly typed, and the automatic coercions that it does can produce surprising results. "2" + "3" is "23" (+, when applied to two strings, performs concatenation); "2" * "3" is 6. (Multiplication not defined for strings; so the language tries converting them to numerals, succeeds, and multiplies those). This can be surprising.
Rather annoying gotcha in array constructor. new Array() produces empty array; new Array(2,3) produces array with 2 and 3 as its elements. new Array(5) does not produce array with 5 as its single element; instead, it returns a 5-element array!
Whereas most languages have one universal singular value (null/nil/Void/whatever); JavaScript has three - "false", "null" and "undefined". That leads to confusing and irregular semantics.
No integral types - the only numeric type supported is an IEEE754 double-precision float. For a scripting language, this limitation is probably less obnoxious than it would be elsewhere.
Language has LexicalScoping, but with an interesting twist. Unlike JavaScripts brethen C/C++/Java/C#/etc, where variables introduced in an anonymous block within a function are only valid within that block; in JavaScript such variables are valid for the entire function.
Every script is executed in a single global namespace that is accessible in browsers with the window object.
Automatic type conversion between strings and numbers, combined with '+' overloaded to mean concatenation and addition. This creates very counterintuitive effects if you accidentally convert a number to a string:
var i = 1;
// some code
i = i + ""; // oops!
// some more code
i + 1; // evaluates to the String '11'
i - 1; // evaluates to the Number 0
The automatic type conversion of the + function also leads to the intuitive effect that += 1 is different then the ++ operator:
var j = "1";
j++; // j becomes 2
The Achilles Heel of JavaScript is its inconsistent behavior across implementations. It is virtually impossible to use it to do anything robust on the client side.
This was true years ago, but isn't anymore. Any semi-modern browser has a consistent and well-tested core language and DOM APIs for dealing with HTML/XML documents, event handling, etc.
JavaScript is weakly typed, and the automatic coercions that it does can produce surprising results.
Yes, type coercion can be confusing. So don't do it. Use strict equality (=== and !==), and explicitly convert things to booleans using ! or !! in comparisons to make your intent clear. It's a language flaw, but not a hard one to avoid.
Rather annoying gotcha in array constructor.
Fair point. Fortunately there's a concise syntax for creating array literals that saves you from ever having to touch the Array constructor: [].
Whereas most languages have one universal singular value (null/nil/Void/whatever); JavaScript has three - "false", "null" and "undefined". That leads to confusing and irregular semantics. false doesn't belong in this category at all. Whoever wrote this is confusing type coercion with nullity. I agree the distinction between null and undefined was a design mistake. They should've used null everywhere. That said, in good code you can treat undefined like a sentinel: if it shows up in your program, you're probably doing something wrong.
No integral types - the only numeric type supported is an IEEE754 double-precision float. For a scripting language, this limitation is probably less obnoxious than it would be elsewhere.
For any situation where this is important, you can use typed arrays. [1]
Yes. Banish the language from the existence and use a substitute.
Name:
Anonymous2013-02-12 4:23
>>15
Nobody has bothered to publish a new standard. I want to see client-side web scripting in R6RS.
Name:
Anonymous2013-02-12 8:10
I want to see SEXprs become more popular by any means. The past is Lisp, the present is Lisp, the future is Lisp.
Name:
Anonymous2013-02-12 10:05
The only reason I can think of where Javashit is appropriate for a scripting engine is if the implementor of a piece of software wants:
1. to punish its users with a shitty scripting language with the only benefit that it isn't completely balls slow,
2. to pretend their app is a web widget engine, the 120,000th app to do so,
3. to gain the benefits of running Mentifex AiMind.
"CLOUD SCALE"
Name:
182013-02-12 10:33
... But then I also don't like FIOC either so you have a tiny little redeeming point >>1.
>>21
plus there is no other dynamic language that even remotely approaches v8 in performance and especially absurdly low memory usage for such considering all the jit state it has to keep
>>22
any brick that gets enough jewish funding can get enough momentum to fly, hymie
Name:
Anonymous2013-02-12 17:30
Well, given the choice between a brick that is widely deployed and flies reasonably well, and a sleek glider that is better designed and faster but available nowhere and used by nobody, guess which one I'll pick for any serious work.
>>29 Nobody else uses Javascript on the desktop, because it's one of the worst languages in common use. It's not tried and true in that space, it's just a shitty competitor which was elevated to to official status due to its popularity in another domain.
Name:
Anonymous2013-02-12 17:36
>>29
The glider? Glad to know there are reasonable Gentiles in this world.
By the way, I'm just wondering: have you goys ever craved jewish cock so badly that you found yourself running around outside, howling at the moon for it? Literally ROARING at the top of your lungs, wanting nothing less than a jews's dick head churning against your glottal stop?
>>30
That's not quite true. Firefox uses JavaScript for most of its user interface, and (obviously) GNOME Shell and Windows 8. Most desktop apps are just glorified widget-layout engines, anyway, which makes scripting languages convenient. For any truly computation-intensive work you can always call a native library.
it's one of the worst languages in common use
Despite JS's warts, it's concise, portable, performs OK, and is not Java, C#, or C++. That makes it pretty good in my book. YMMV.
elevated to to official status due to its popularity in another domain.