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-28 14:47

So lets see, your complaints are:

* It's a dynamic language! But I'm used to static types!
* It's a prototypal object model! But I'm used to classical inheritance!

Listen bro, there are problems with Javascript, but all I see here is user error. Clearly you are versed in paradigms that aren't exploited by Javascript. You have to open yourself up to Javascript's mutability to see how its a strengths. All of the problems you cited aren't actually problems if you program Javascript like its Javascript, and not Java, or Python, or Scheme for that matter (the language from which Javascript takes most of its inspiration).

Good books with stupid names you should look at:
Javascript: The Good Parts, Crockford
Secrets of the Javascript Ninja, Resig

>>6
I have a feeling OP is not really using closures, but I disagree that just because the bound object model can be tricky it means you straight up shouldn't use it.

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