

JavaScript - It’s a Real Language - rvbyron
http://clubajax.org/javascript-its-a-real-language/

======
pseudonym
I think the "loose and flexible" aspect is why so many people think it's a
joke. For the longest time, the only Javascript I learned was from online
tutorials, and 90% of those were complete and utter crud, showing different
ways of doing the same thing that were still acceptable because of how
accommodating Javascript is with syntax errors. Because of the fact that no
two tutorials were the same, I never wanted to touch Javascript.

Later I picked up an O'Reilly book about "the good bits" of Javascript and
enjoyed it immensely, but the amount of parseable cruft out there doesn't help
up-and-coming JS coders in the slightest.

------
RyanMcGreal
I know it's been said many times, but Crockford's _Javascript: The Good Parts_
is a wonderful approach that squeezes maximum value, maturity and robustness
out of a mostly-good language with some spectacularly bad bits.

~~~
InclinedPlane
Javascript has 3 serious, fundamental problems. The first is that it's a
prototypal language that's been forced into looking like a class-based OO
language. This leads people to confusion and frustration, much the same as if
you were making a burrito and someone replaced your ingredients with pita
bread and hummus. If you try to work against the grain by imagining that JS is
just another class-based language you will end up thinking that it's some
crazy mutant language that doesn't make sense. If you go into it understanding
the paradigm and how to make the best use of it you'll get much better
results.

The second major problem with Javascript is that it was prematurely
standardized due to excessive pressure to ship during development, and thus
has a lot of little mis-features and defects in the core language that haven't
been fixed due to concerns about breaking backward compatibility. Luckily it's
generally possible to avoid these areas of the language without having to
compromise your code so it's just a matter of keeping to good practices and of
knowing what to avoid.

The third problem is that Javascript is primarily a web technology where it is
married to the DOM, and historically browser DOMs have been a mess: non-
standardized, buggy, sometimes slow.

Overall the result is a language with a few landmines that need to be tiptoed
around but that is still very solid in its fundamentals. Compare that with
many other languages that are more polished and yet fundamentally limited in
significant ways (such as Java's lack of closures, for example).

The wonderful thing about JS is that because of its expressiveness, power, and
advanced featureset, using the language properly becomes a potent self-
reinforcing feedback loop, jQuery is one of the better examples of this.

~~~
orangecat
Exactly right. I don't understand why there can't be a Javascript 2.0 that
fixes its ridiculous misfeatures, and that you opt-in to with <script
language="js2"> or something. So browsers would have to include two
interpreters, but they're so bloated as it is I doubt it would be noticeable.

~~~
wallfly
Check out Joose, which is an object layer built with JavaScript on top of
Javascript, amazing stuff!!

<http://joose.it/>

[http://openjsan.org/doc/s/sa/samuraijack/Joose/3.011/lib/Joo...](http://openjsan.org/doc/s/sa/samuraijack/Joose/3.011/lib/Joose.html)

------
endtime
I didn't really appreciate JS when I had to use it for a school project. But,
believe it or not, I gained an appreciation for it via CoffeeScript. Replacing
the syntax with something more concise showed me that the underlying
fundamentals of the language are pretty clean.

~~~
hnal943
I had a similar experience learning to use mootools. It got rid of so many of
the ticky-tack compatibility problems and just let me work on the problem.

------
OmarIsmail
It's my personal opinion that Javascript is the language of the future. One
could argue it's actually the language of today with everything becoming a
rich Web App. I'm not a hardcore CompSci language expert by any means - have
just used dozens of languages over the years - and Javascript has become my
favourite language by a large margin. The simplicity and flexibility of it is
just so appealing. It's the GTD done of programming languages. I should also
add that I don't have too much experience with functional languages just a
little dabbling in Scheme and Lisp.

~~~
powrtoch
Sounds like Atwood's Law: [http://www.codinghorror.com/blog/2007/07/the-
principle-of-le...](http://www.codinghorror.com/blog/2007/07/the-principle-of-
least-power.html)

~~~
contextfree
As I think some commenters noted, he's badly misunderstood what the W3C folks
meant by "least power". JavaScript doesn't remotely qualify.

------
jbarham
Speaking of JavaScript, O'Reilly's Ebook Deal of the Day for today is the
guide to Google's Closure JavaScript suite for $15. See
<http://oreilly.com/catalog/9781449381875/> and use the discount code DDSDF.
(I am not affiliated w/ O'Reilly.)

------
jganetsk
I'm going to use this opportunity to plug Google Apps Script, an awesome
server-side JavaScript platform.

<http://code.google.com/googleapps/appsscript/>

------
niels
This dude is late to the party. This seems to me like something that could
have been written two or three years ago. Lots of developers have for a long
time appreciated the powerful features and expressiveness of JavaScript.

------
brianobush
Can I run JS from the command-line yet? e.g., jsrun code.js

~~~
carussell

      16:30:33 spade@ruta-corsica:~$ passgen
      jygugiy5
      16:30:35 spade@ruta-corsica:~$ file `which passgen`
      /home/spade/bin/passgen: a /home/spade/bin/js -ws script text executable
      16:30:40 spade@ruta-corsica:~$ head -n 3 `which passgen`
      #!/home/spade/bin/js -ws
      /* passgen - configurable password generator
       * Copyright 2005 Colby Russell

------
16s
We'd be better off without JavaScript embedded into Websites and PDF files.
Granted, it adds functionality, but if you've ever tried to keep hundreds of
Microsoft Windows PCs from being infected with malware, you'd understand.
Things are simpler without it.

~~~
cryptoz
Just because one OS has security problems doesn't mean the world would be
better off without this amazing functionality.

I think JavaScript embedded in websites is one of the most important abilities
in the web today. It's critical to the way nearly all modern applications are
written and it allows for extremely fast and rapid development of scalable
powerful applications.

Awesome, no?

~~~
kenjackson
While Javascript is better than nothing, I'm one of the few proponents left of
a strong, lightweight, maybe standardized, plugin model. I'd rather write with
an appropriate language for the task at hand.

If my site would best be served by Lisp, or Haskell, or Java, or Javascript,
or C#, or Python... let me decide. It just feels like we've entered this world
that everything has to be Javascript, if its appropriate or not.

~~~
DanielRibeiro
Or you can just compile a language you want to javascript. Treat it like
assembly. You can be glad it works, but you'd rather not write in it directly.
Examples of such: coffescript (<http://jashkenas.github.com/coffee-script/>)
for those who like python/ruby, ruby (though this is not perfect:
[http://stackoverflow.com/questions/3593312/production-
usage-...](http://stackoverflow.com/questions/3593312/production-usage-of-
compiling-ruby-red-to-javascript)), GWT (somewhat butchered java ->
javasscript) and scriptjure (<http://github.com/arohner/scriptjure> Clojure ->
javascript).

~~~
contextfree
If we're going to be doing that, wouldn't it maybe be better to compile to
something that was actually designed as a compilation target (like the JVM/CLR
- which are apparently the dread scourges JavaScript saved us from - or LLVM)
rather than roping in an HLL _not_ designed for the job?

~~~
DanielRibeiro
The JVM wasn't originally createf for other languages as well. I agree it
would be great if a vm such LLVM was builtin on all browsers. It is not, as
specs that move the a better web development environment are not as aggressive
as one would like, both in design and (even more prominently) in
implementation.

The thought that developers should wait for browsers to catch up with their
needs is what leads to such situation. But, if the JVM finally decided to host
other languages, _after_ they got a lot of attention, maybe so will browsers.
But we need to justify it first. Not wait.

