
JavaScript: The World's Most Misunderstood Programming Language Has Become Most Popular - initself
http://javascript.crockford.com/popular.html
======
gruseom
It is a fortunate historical accident that Eich was infatuated with ultra-
dynamic languages like Scheme and Self when he came up with JS. For all its
flaws, JS retains enough of their DNA to have given rise to the wonderful
world of web apps and, effectively, take over the world. When you consider how
many historical accidents went _against_ this style, I think we're lucky to
have JS. And it does seem to have been an accident, given how hard Eich has
been trying to turn it in to something else (for "serious" programming don't
you know).

p.s. I've written this here before, but can't track down the link.

------
joe_the_user
An interesting argument.

I suspect that js is not yet the world's most popular language but by this
link's argument, it may become one of the world's most popular languages.

However, as ajax evolves, js may become more of a "virtual machine" into which
the initial UI source code is compiled rather than being the raw language in
which the UI specified.

~~~
litewulf
I want to say something about leaky abstractions and caution the reader that
writing code that you then pass to something that generates some other code is
a very very scary thing by and large. The Java compiler and gcc are really
mature, and every so often bugs are still spotted. Imagine if you're super-
awesome-Objective-C-to-Javascript compiler has a bug. How do you know if the
bug is in your Objective-C code, in the compiler, or just a weird browser
oddity? Basically you end up kind of needing to know everything between you
and the browser, so it may be a good idea to minimize those things.

(Actually, I recommend sitting down and writing Javascript without a library,
just so you have an idea of what works and what doesn't across browser. It was
somewhat surprising for me to be sure.)

~~~
DLWormwood
> I want to say something about leaky abstractions and caution the reader that
> writing code that you then pass to something that generates some other code
> is a very very scary thing by and large.

You are aware that programmers have been doing this in essence since Assembly
Language was invented right? Programming directly in binary is just too much
for our human minds to take.

That said, you are much more correct than you realize. Even programming a
"simple" or "direct" translation, like compiling from C to object code is rife
with pitfalls...

<http://cm.bell-labs.com/who/ken/trust.html>

~~~
litewulf
Well, yes, hence my explicit mention of GCC and the java compiler. :)

In general, as long as the compiler is bug free, you should be fine. Its just
that never running into a compiler bug is much less likely when you're using
very new code. Code is often buggy after all ;)

------
Tichy
JavaScript is not only "not too bad", it is actually great. I wonder if it is
even cooler than Lisp, because those hashes that are objects and arrays and
everything are so versatile. Sure it would be fairly easy to create a JS style
object system in Lisp, but I think it isn't there from the start (only know
Scheme, a bit).

------
InVerse
js itself isn't so important.

already the desktop UI approach (think Java AWT/Swing) is gaining traction, eg
GWT.

nonetheless, if using js directly, the js itself isn't so important: * use a
good js library with helpful abstractions for DOM traversal, manipulation, etc
* use good js frameworks, eg for compiling data plus templates into html * use
ajax to get html

~~~
arockwell
Do you actually know anyone who uses GWT? I have not heard good things about
it. I personally would rather ues plain javascript with jquery.

~~~
litewulf
I actually use GWT, and my advice is to be very careful.

I've managed to have bugs that show up in the browser that I have had an
amazingly difficult time tracking down. You get a pile of javascript from your
pile of java, and it can be hard to tell where the bug is at all.

Complexity is dangerous, and GWT is fantastically complicated. I haven't run
into a GWT compilation bug, but I'm sure there exists such a thing, and the
day I run into it I will simply sit down and cry because I have no other
recourse.

(But when it works, I guess its kind of a nice way to build UIs, if you like
Java-style UI APIs... I've never met such a person, but I'm sure they exist
;))

------
apstuff
FYI: Douglas Crockford is a contributor to Yahoo UI Theater. His lectures on
js can be found there.

<http://developer.yahoo.com/yui/theater/>

------
zandorg
It doesn't have anything to do with Java. They just added that to increase the
Netscape stock ticker.

------
albertcardona
One should read this instead (from the same domain):

<http://javascript.crockford.com/javascript.htm>

------
Allocator2008
Since when did javascript become a "language"? Is it even Turing complete? I
thought the word "script" meant "scripting language" which is NOT the same
thing as a full fledged language. If indeed javascript is the most popular
"language" then God or Turing help us all.

~~~
lunaru
LOL, I suppose Lisp is not Turing complete either. JavaScript happens to be
one of the most elegant languages (sans the DOM and browser stuff that is
tightly coupled with the language)

~~~
jrockway
You use the word elegant like it's an objective statement, which it is not.

I would disagree about it being elegant. It's a fine language, but it has no
unifying concept. It's procedural, it has anonymous functions, it has simple
OO built-in. This isn't really elegance because you can't go anywhere
uncharted with this. The simplicity is there because there isn't much built-
in. Code is not data. There is no module system. There is no generalized flow
control. (I am not sure why language designers like manually implementing
function calls / return, exceptions, loop/break/continue, etc. when
continuations generalize all of this.)

Anyway, JavaScript is useful, but it is a limited subset of nearly every other
language. This may be good, but where features are missing, everyone has their
own incompatible "fix" for that. That may or may not be elegance; I'm not
sure.

