JavaScript Inventor Speaks Out
Anonymous Coward writes "Brendan, on his mozillazine blog talks about JavaScript 1, 2, and in between in light of DHTML and AJAX. In an informal blog entry he answers frequently asked questions such as fixing Unicode in regular expressions, multi-threading, weak numeric typing, and obfuscating code."
If the "write once, run everywhere" feature was implemented. ;)
On a related note, I had an interview at Adobe a while back and the interviewer mentioned that javascript was the scripting language for a lot of their products. I drew a blank on that one since I had no idea how use javascript for an application (and, subsequently, didn't get the job). When an application uses javascript for the scripting language, does that mean a javascript parser is also implemented into the application? Or can javascript be used in a standalone environment?
It's a pity JavaScript rarely gets the attention it deserves as a legitimate programming language. Most guides to C begin with teaching you how compilers work; most guides to JavaScript teach you how to swap some images.
This is unfortunate as it's quite powerful: it supports first-class functions and an excellent generic object-system, not to mention the usual suspects such as dynamic memory management.
Hopefully its apparent resurgence these days (as browser vendors get their compatibility acts together) will change this.
((lambda x ((x))) (lambda x ((x))))
As someone who'd only used Javascript in creating DHTML, I'd worked up a good hate against it. But what I'd hated was really the ridiculously incompatible implementations of the DOM in IE/Netscape. I also hated the embedded space itself--shitty delivery method (encoded or called from HTML, no #include, no namespaces).
Then I started writing extensions for firefox. I'm trying to show my company that (firefox + xul + js) > (ie + activex). I'm mostly successful, since we already have lots of XML over HTTP data services primed for XmlHttpRequest.
But it turns out that the language doesn't suck so bad. Sure the namespace problem is JS's fault, but the rest is the embedding. Using JS for firefox exntensions allows you to code to one platform; make more OO libraries, etc. I even generate classes from the DTDs I make the XML services from.
Who would've thunk it's really a decent language in the dynamic, lambda-toting, functional-ish area?
I think by the time Javascript came along, Sun had pretty much lost interest in TCL. I heard stories about people trying to license the Sun implementation of Tcl/Tk and getting a runaround. It's probably not a coincidence that Ousterhout left Sun (and took Tcl with him) at about the same time as Eric Schmidt, who brought Ousterhout on board in the first place.
Especially when combined with XUL.
My server
If that's your "secret" then you need to get out more. :+) Seriously, give Ruby a try. I think it will quite easily scratch the itch you're expressing. It has none of the confusion surrounding it that JavaScript does and it's quite a worthy desktop application and web application language. Oh, and if you're going to give Ruby a try and aren't totally addicted to Emacs or vim at this point, then give the Arachno IDE for Ruby (at http://www.ruby-ide.com/) a spin. It's not free, but it is cheap.
FYI - Learning Java can also be worth your time; it's not so bad. But really, if you're going to have your application execute on the client in a browser, then Java really isn't a good choice these days. (Although I'm sure some would beg to differ; it is *possible* after all. I just don't recommend it.)
Have fun!
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
I'm sorry, but this comment simply doesn't hold:
JS is not going away, so it ought to evolve. As with sharks (and relationships, see Annie Hall), a programming language is either moving forward, or it's dead.
No, when a programming language doesn't chance, it's called a standard. Look at what we've been able to do keeping html, css, and javascript a stable target for so many years! It's like Space Invaders on the Atari 2600 -- nobody who created that console, its hardware designed specifically for playing Combat and Video Olympics, expected someone to be able to slap six sprites in a row, much less have the player shoot then down one at a time. The 'standard' that was the 2600, however, gave a stable platform for programmers to learn tricks that would give the console life well beyond its creators' expectations.
We've got something like that with javascript, and we can see what happens when we compare to something like Visual Basic 6. Developers are still upset about Microsoft's decision to drop official support for VB6 in an attempt to force people to upgrade to VB.NET. Know what? Those upset programmers have found that VB6 hasn't rusted and simply continue using it to create their apps. There are more companies than you'd know (here's one) whose major apps are/were written in VB6, the 'prototyping language'. They're not quite ready to cast the baby out with the bath.
Fix bigs in javascript? Absolutely. The issue is that we've reached a point where nearly every browser anyone uses supports a 'single' flavor of javascript and we're all familiar with how to make our code work with the few quirks that remain crossplatform. There is a standard on nearly every box on the net that coders can assume will be there for them. I wouldn't want to see anyone mess this stable delivery platform up, splitting the user base into something like what we had in the Netscape 4.x/Mozilla/IE 4 & 5 days. Now *that* was an ugly time to code.
The bottom line is that evolution is an overused metaphor. You've got two choices if you'd like to propagate your genes into the future: immortality or reproduction. Immortality was a little too difficult to accomplish for living, unique individuals. Perhaps there were little organisms that could live forever, but something squashed 'em. They're gone. That's not a problem in the digital world, folk. We can make as many exact copies of an individual as we'd like. Javascript modules are not unique. They don't need to evolve. (I mean, come on, he even mentions sharks, a design that hasn't changed in millions on millions of years!)
Javascript should shoot to become an immortal standard, not another field of play and debate.
It's all 0s and 1s. Or it's not.