JavaScript is a scam

JavaScript is unsuitable for any serious development.

The only people who think this is good for anything are those who never had to use it for anything beyond little “onclick” scripts on a webapp. Just because Google used it it doesn’t make it automatically good.

The crappiness comes from the fact that it doesn’t support inheritance. This might not seem a problem for a small app, but as it grows you would need to better organize your code. Some methods might be needed by several objects, thus requiring a component hierarchy.

Well, in JavaScript that’s impossible.

Some JavaScript developer might say: “You can simulate it with design patterns.” Google it and be afraid of the sheer amount of stupidity you need to suffer in order to get something that resembles sanity.

Why even bother with it? Shouldn’t you just use a language that allows you to do what you need done?

JavaScript is just for tiny scripts and that’s it. And even then there are better options out there.

The hype for this piece of shit is just unbelievable.

Shame isn’t it. Hopefully something will come along to oust it.

Cas :slight_smile:

Yawn. Now you’re not even trolling the right language.

JS is fine for little web scripts, which is all it was intended for. The problem is that now people want to do real software engineering client-side and JS just isn’t up to the task. Various people want a JS.next, but putting in all the static typing and contract guarantees that would make JS suit people who want to program large systems will just piss off those who like JS the way it is while never satisfying the static/strict crowd.

The root of the problem is the lack of choice. The only real answer is to allow programmers to use whatever language they like client side, which can only really be achieved by having browsers running a byte code based VM which users compile or interpret to.

Now, I wonder what kind of VM could handle that task???

Why are you complaining about your apple not being an orange? xD


/* Inheritance */
var Parent = function() {
};
Parent.prototype.foo = function() {
};

var SubClass = function() {
};
SubClass.prototype = new Parent();

There are other ways of building inheritance, which also depends on how you build your classes. In some ways I’d say JS as a language is kinda lower level then Java, in that you can build most forms of abstraction in pure JS. Classes, modules, local functions (private to one section of code), static functions, classes, inheritance, multiple inheritance, aspect oriented programming, or something custom. You can build it all!

I’ve also written a whole programming language and several web applications in JS, and I much prefer it to Java. I also much prefer HTML/CSS to Swing. I get far more control, and it’s easier to build a wide variety of components, whilst having far less cruft to deal with. I can just concentrate on getting the job done.

There is a bit of a learning curve, to learn all of these tricks you can perform. But once your over it, it’s bliss.

Have you ever built a proper application using JS?

http://legacy-cdn.smosh.com/smosh-pit/112010/main-troll.jpg

Something tells me the author neither knows javascript nor cares. YHBT. HAND.

Errr…Not having inheritance is, like, the whole point.

[quote=“kaffiene,post:4,topic:37455”]
This is not actually true. For example NetScape brought out server side JS just a year after it’s release. It was always intended for more then just client-side scripting.

It still is, see NodeJS for example.

@longino
It seems that you have no clue or whatever about JavaScript. Just consider to really learn a language before complaining about it…

[quote=“kaffiene,post:4,topic:37455”]
Spot on.

Cas :slight_smile:

[quote=“kaffiene,post:4,topic:37455”]
The only improvement I know of over the last 5 years to Applets is the ability to use JNLP files. The JVM might be amazingly fast, but a lack of applet development, and terrible start up times makes it practically unusable for the web. It’s also far more hassle to put an applet together then to build something JS powered.

But in terms of having a VM to target, rather then JS, I used to think this would be a good idea too. Now I’d rather see a high-level intermediate language, like C–, as it would be much easier to target. If they allow the same, then there is no benefit in having to output bytecodes over ASCII text (the latter is much easier to work out and debug).

Not as in applets, but as a general purpose execution engine with access to the DOM, just like JS has. Applets are a dead technology - Flash probably going the same way too along with all other plugins. HTML5 ftw.

Also, startup time need not be slow at all. Firstly, if Flash can start up instantly, then brilliant. Secondly, look at JamVM and Dalvik. Perfect. The ability to embed script as base64 encoded jars would be awesome.

Cas :slight_smile:

Could Dart be a first step in the right direction, then?

Dart sounds like a great big Google NIH and will flop, having no compelling reason to exist other than JavaScript-nerd-envy.

Cas :slight_smile:

It does compile to ECMAScript (to be compatible with other browsers), and does compile to a VM, which will be embedded in Chrome, and the promise goes, available to other browsers as well. At least in theory, it could work… but I share some of your concerns, too.

That ‘general purpose execution engine with access to DOM’ is already here, and it’s JS. There’s more and more languages and frameworks targeting JS as their eventual output format. Sure it’s a big chunky ascii format rather than bytecode, but that’s pretty much the only disadvantage IMHO.

That, and the fact it’s never going to be as fast as straightforward Java bytecode can be due to the design of JS. And of course all of these JS-targeting things are riddled with incompatibilities and bugs. It makes no real sense.

Cas :slight_smile:

LLVM bytecode would be another decent contender but much of the attraction of Java is the existence of a well-understood and decent platform of APIs. It is indeed the only reason I’ve bothered looking at Android.

Cas :slight_smile:

Like I said before, Javascript developers will try to convince others that using convoluted Design Patterns for simulating inheritance is actually a good thing.

No, it isn’t. It is still crap. Your code (that is supposed to look simpler than Java, right?) will look like diarrhea.

It is easier just to use the right tool for the job. And JavaScript isn’t suitable for any job.

No, you can’t.

You can stuff functions inside of objects, and that’s all. That’s not metaprogramming.

You want to see real metaprogramming. Try Lisp. Your jaw will hit he floor and I promise you will never ever want to touch this filthy Javascript again. It is like the difference between a bicycle and the starship Enterprise.

The quality of your “programming language” must really low. Javascript doesn’t allow simple things that would make good design.

No, it isn’t. I tried and the more I learned the more outraged I got for being forced to work in such a primitive way. There are a dozen languages out there, especially on the JVM, that do a much better job.

JavaScript simply lacks many constructs that you get for free in more advanced languages.