Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I hate javascript

Name: Anonymous 2011-09-28 13:24

Currently I am learning how to program windows 8 metro apps using Javascript.

I have some prior experience with javascript, but only with the stuff js was actually designed for: small snippets embedded in HTML code. This is the first time I am developing a complete application in js. And I got to say: the more I learn about it the more I hate it.

-no type safety
-all errors except for the most trivial syntax errors can only be found at runtime when the code in question is executed
-a mistyped member variable of an object, is even silent at runtime, because you needn't declare public member variables of classes, even when using 'use strict'.
-OOP is a joke. Most features which should be standard repertoire of an OOP language are only available through nasty hacks. Most annoying flaw so far: event handlers can't call instance methods*. wtf? how am I supposed to create a proper MVC pattern, when my controllers can't be instanced?

Why do people keep promoting this shit? Sure, you do everything nowadays in a webbrowser, and in a web application, javascript is the only standardized, platform-independent way to have any logic in the client. So you don't get around using JS when you have a web application. But why do people promote this abomination of a language for areas where much more viable alternatives exist? Like stand-alone client applications (windows 8 metro apps) and even server applications (NodeJS).


*They can call them, but they are executed in a static context, not the context of the object, which means that you can't access any member variables.

Name: Anonymous 2011-09-29 0:07

Welcome to the "wonderful" world of JavaScript!


$ js --version
JavaScript-C 1.7.0 2007-10-03
usage: js [-PswWxCi] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
$ js
js> 0 == ''
true
js> false == 'false'
false
js> false == '0'
true
js> false == undefined
false
js> " \t\r\n" == 0
true
js> Math.min() < Math.max()
false
js> ",,," == Array((null,'cool',false,NaN,4))
true
js> var foo = [0]
js> foo == foo
true
js> foo == !foo
true
js> function toInt(number) {return number && + number | 0 || 0;}
js> toInt("1")
1
js> toInt("1.2")
1
js> toInt("-1.2")
-1
js> toInt(1/0)
0
js>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List