JavaScript: The Lingua Franca of the Web

May 21, 2007

Mike Shaver, a founding member of the Mozilla team, has strong feelings about how the web became popular:

If you choose a platform that needs tools, if you give up the viral soft collaboration of View Source and copy-and-paste mashups and being able to jam jQuery in the hole that used to have Prototype in it, you lose what gave the web its distributed evolution and incrementalism. You lose what made the web great, and what made the web win.

The radically open source, viral nature of the View Source menu is certainly a key part of the web's success. But that's only part of the story. The increasing maturity of the JavaScript implementation in modern browsers is the foundation of the web's present and future:

One ingredient of [Web 2.0] is certainly Ajax, which I can still only just bear to use without scare quotes. Basically, what "Ajax" means is "Javascript now works." And that in turn means that web-based applications can now be made to work much more like desktop ones.

Like many programmers, I initially wrote off JavaScript as a toy language. Even Douglas "my middle name is JavaScript" Crockford was guilty of this misconception:

When JavaScript was first introduced, I dismissed it as being not worth my attention. Much later, I took another look at it and discovered that hidden in the browser was an excellent programming language. My initial attitudes were based on the initial positioning of JavaScript by Sun and Netscape. They made many misstatements about JavaScript in order to avoid positioning JavaScript as a competitor to Java. Those misstatements continue to echo in the scores of badly written JavaScript books aimed at the dummies and amateurs market.

Regardless of your original feelings towards the language, JavaScript has come a long way since the bad old days of 1995. We've got CPU power to burn on the client; so much power, in fact, that even an interpreted, dynamic language like JavaScript can be a credible client-side development environment. The language has been standardized as ECMA-262, edition 3 since 1999, so there's now a reasonable expectation of compatibility across browsers.

More and more websites leverage JavaScript to stretch the boundaries of what the browser can do. The idea of browsing today's web with JavaScript disabled is almost quaint. With the success of so many startups based on nothing but JavaScript, HTML, and the server-side language of their choice, you'd think JavaScript would enjoy some hard-won respect by now. But I still see a lot of angst and ennui towards JavaScript from developers, even today. Scott Koon had a clever way of putting it:

[JavaScript won] by default. People wanted to build better web applications. Programming against Flash movies sucked. Javascript was already in all the browsers. If you're the last man left on earth, it doesn't matter how ugly you are when the women come to re-populate the planet.

Some programmers will do almost anything to avoid getting their feet dirty in the highly imperfect world of JavaScript. Vendors are all too willing to offer up their alternatives:

Despite all the pretenders to the throne, JavaScript isn't going away any time soon. JavaScript is the world's most ubiquitous computing runtime. It's time we learned to accept and embrace JavaScript rather than blindly fighting it. That doesn't mean we can't explore alternatives-- but the best way to transcend the limitations of JavaScript is to immerse yourself in those limitations. At least that way you know what you're fighting for, and what the alternatives really mean.

Is JavaScript annoying at times? Sure. Is it aggravating to deal with all the cross-browser issues you'll inevitably run into? Absolutely. Is debugging in the browser a pain in the butt? You bet it is, although FireBug helps. But JavaScript, in its way, is as groundbreaking as it is infuriating:

JavaScript's C-like syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. This is misleading because JavaScript has more in common with functional languages like Lisp or Scheme than with C or Java. It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens.

JavaScript is the lingua franca of the web. Ignore it at your peril.

If you're looking to get reacquainted with JavaScript, the best single resource on the web is still Douglas Crockford's site. I can also recommend Douglas Crockford's series of Yahoo videos, which provide an excellent overview of modern thinking in JavaScript.

You can download the companion slides for these presentations from the excellent Yahoo User Interface Blog.

There are some exciting JavaScript alternatives on the horizon. Some will be successful; some won't. In all the hubbub over new tools and new choices, don't forget that JavaScript remains an excellent choice for rich internet application development -- and as the existing lingua franca of the web, its success is guaranteed.

Posted by Jeff Atwood
65 Comments

"the idea of browsing today's web with JavaScript disabled is almost quaint."

Quaint, huh? I highly recommend you take a look at all the XSS exploits and security holes that are left unfixed and I'm sure you'll come to the conclusion that browsing the web with something like the http://noscript.net extension is the only way to go these days.

Other than that, I can only agree. It's scary but it's true: Javascript has become what Java should have been ...only way way much uglier.

Toni on May 21, 2007 7:44 AM

Can't wait for JavaScript Intellisense in Orcas.

nbirkes on May 21, 2007 7:44 AM

I've made a nice living in Javascript over the last decade; while others were struggling with the Java AWT or Swing, or coding apps into movies with Flash, I was writing rich UIs that Just Worked, and were Just Dead Easy to write.

For more on just how powerful JS can be, see

Open Rico: http://openrico.org/rico/home.page

Prototype.js: http://www.prototypejs.org/

Check out their links, too.

Brook Monroe on May 21, 2007 7:59 AM

But don't Flash and Flex use JavaScript (excuse me, ECMAScript) as their scripting language?

Mike Swaim on May 21, 2007 8:16 AM

I've been adding snippets of jQuery to html pages for a while and it's just what I needed... small almost-standalone snippets of code to do things like sortable-html tables, drag-n-drop trees, and ajax forms that are almost invisible enhancements to basic HTML forms I was already creating.

Demos make the best impression, so take a look at a jQuery http://jquery.com and one of it's most popular plugins called interface http://interface.eyecon.ro/demos

Eric on May 21, 2007 8:28 AM

The problem isn't really JavaScript. The problem is web development in general. JavaScript is useless without an HTML page and the associated ugliness that comes along with it. I'm no fan of JavaScript but I'm an even lesser fan of all the crap that is "web development" today.

We need to just start over again. Until we do we will be living with the world's biggest kludge for the rest of our lives.

Matt on May 21, 2007 8:30 AM

"Flash and Flex use JavaScript "
Yeah, and so can Silverlight. JavaFX is a little different I believe.

Matt: Seaside sounds like an interesting framework and it's about as far from dealing with HTML and Javascript as you can get and still write a web app. I've always liked the idea of delivering a web application as a complete image deployable on any platform.

As far as the power of Javascript goes, check out the following toolkits
Mochikit
MooTools
Dojo (some of the new offline storage objects are fascinating)
The entire Yahoo library makes Javascript development a lot less painful.

Scott on May 21, 2007 10:18 AM

I think one of the key reasons javascript is dismissed is due to the lack of tool support. At least in the Microsoft world.

Or is the lack of tool support because javascript is dismissed by developers? Damn chicken-egg problem!

In any case, it's good to see Microsoft *finally* coming around and recognizing javascript in the next release of VS.NET. It's long overdue.

Haacked on May 21, 2007 10:24 AM

JavaScript is a fine language, comparable to Ruby and Python, even better in my opinion. The thing that suck about developing web apps is the amount of browser differences, bugs and quirks brought to us from the stupid pointless browser war. You see, these morons just never learn from history; instead of fixing their browsers they keep churning out steaming pile of bloated proprietary crap like silverlight and flex. It's browser war 2.0 all over again. It's stupid and non productive. This is NOT progress people.

wageslave on May 21, 2007 11:04 AM

Doesn't JavaScript still have those funky rules where it guesses where there ought to be a semicolon or something?

http://www.mozilla.org/js/language/es4/rationale/syntax.html et al.

Bob on May 21, 2007 11:20 AM

It's nice to see that javascript, and available libraries have reached the point where they're easily usable. Initially I was dissappointed with all the compatibility issues, etc, given that it's ubiquity made it so tempting to use. In fact, now that I think about it, there was a long time where it seemed very rare to find javascript that actually worked properly.

I've gotten back into its use with ruby on rails and other frameworks, and I think this is the best approach, given that it allows the sharing of libraries, so the fiddly bits only have to be done once, and a good system for falling back on basic commication with the server when javascript isn't available.

drinkingbird on May 21, 2007 11:36 AM

I think Flex, Java FX and silverlight is good alternatives for client side rich UI. Javascript is good as most google and yahoo using that along with AJAX, but this new framework provide more functionality and power, with help of oops support.

Mayank on May 21, 2007 12:20 PM

"In any case, it's good to see Microsoft *finally* coming around and recognizing javascript in the next release of VS.NET. It's long overdue."

I may be wrong but I don't think intellisence with javascript was possible until the recent overhaul in the way intellisence works in Orcas.

[ICR] on May 22, 2007 2:09 AM

Imagine what one could do with a really good javascript IDE.

The IE javascript "debugger" is one good reason why people hate javascript. .. "You have an error at line 1" .. weee :)

On other could be that it is so d@mn easy to make ugly javascript.

Personally I believe that html is the evil one. If it wasent for CSS, html would be the most anti-DRY thing you could ever come up with.

Peter Palludan on May 22, 2007 2:22 AM

Luis' Parenthesis "The lure of JavaScript is so great now that, like PHP, HTML and CSS, JavaScript is becoming a kid's language."

Well I'm sorry to tell you that this can be applied to any language like Ruby, C#, VB.Net, c, etc. What needs to be considered is not the language its written in, but what is written.

I'd also like to make the point that HTML and CSS are not programming languages so i don't know why you mentioned them.

Mike on May 22, 2007 2:25 AM

Both Netscape and Microsoft offered server-side Javascript back then.

Sorry foobar, but I thought Microsoft offered server-side JScript?

I might be mistaken, but it seems like Microsoft is inventing new standards upon already existing standards.

Peter Palludan on May 22, 2007 2:28 AM

"Ignore THOSE people at your own peril."

oh we've been doing that for years! ;-)

Eric on May 22, 2007 2:33 AM

Some beautiful javascript : http://www.extjs.com

Maxence Delannoy on May 22, 2007 3:04 AM

Interesting how many of the comments here completely ignore the point of your post in favour of trotting out the same tired prejudices the writers have been carrying around for years without ever bothering to learn about the subject. As a JS programmer for over 10 years I've pretty much given up bothering to even notice such snarkiness; it reminds me of people who rail against garbage collection, or argue that object orientation offers no benefits over FORTRAN 77-style procedural programming.

Twenty-odd years ago I was writing systems software in assembly language; I was happy to point out to anybody who dared to sing the praises of C that my code could kick their code's ass any day of the week. But you know what? Technologies develop and change, and just a few years later I would happily acknowledge that, when done skillfully, writing in C was a much more efficient way of producing code that would often perform better than hand-crafted assembler.

Mind, that doesn't mean that people didn't write an awful lot of C code that sucked. To those carping about JavaScript: perhaps you should find out how things have moved on, and realise that to blame the language for the large numbers of rubbish web applications produced by incompetent programmers and designers is a singularly foolish thing to do. It says much more about your inflexible and rigid attitudes than it does about the technology.

Nick Fitzsimons on May 22, 2007 3:05 AM

"I might be mistaken, but it seems like Microsoft is inventing new standards upon already existing standards."

You are, mistaken that is. Microsoft helped establish the standard. Crockford talks about the history of javascript in his videos. Sometimes MS changed Javascript for the better, sometimes for the worse. It's by no means a perfect language. But your choices back in the 90's if you wanted to write a web application that was more than just POSTing to .cgi scripts were VBScript, if you only cared about IE clients, or Javascript. Which is really what I meant in my comment at Udels site. Javascript, the language, back in the 90's was u-g-l-y. But it was available client side in almost all browsers. It meant the difference between your user clicking submit and taking 3-5 seconds to find out that they entered something on their 25 field form wrong and validating your form fields client side and not making the user wait around.

Scott on May 22, 2007 4:02 AM

HTML (XHTML) etc is a markup language for static pages

JavaScript is a hack to make the pages dynamic Ajax is a set of hacks built on Javascript to make it work "properly" ... sometimes

Flash etc.. are plugins to do what Javascript cannot do or cannot do reliably

What we really need is something to replace it and give us a platform that works not a set of hacks built on static pages ...

Jaster

Jaster on May 22, 2007 4:04 AM

As languages go, I love JavaScript. Simply love it. Having been programming mostly in C++ for 10 years I could never stand Java (too verbose and too restrictive and poor on features).

Libraries, however, are completely different story. Libraries are the main reason I am trying to stay away from C++ these days. And lack of any decent run-time libraries, built into browsers is why JavaScript by default looks quite weak. In fact, Flex and Silverlight can be looked at as nothing more but powerful JavaScript runtime libraries.

So it's really not about the language, "it's the runtime stupid"! :-)

Eugueny on May 22, 2007 4:31 AM

Kudos for this post Jeff, it is nice to see someone of your stature in the blogging world champion Javascript for a change! Lots of purest programmers are quick to knock Javascript and the development efforts behind it, while pragmatic programmers have been happily using it for years and years to make things work, and will continue to do so.

john on May 22, 2007 4:56 AM

I agree with Haacked. In the MS world, Javascript has (up until now) been pushed totally aside. Look at their documentation for Javascript (and the DOM). It's total urine compared to the documentation of .NET languages. Not to mention the debugging and error reporting in IE/Visual Studio. It's as though they were pretending that JS didn't exist all this time and that maybe, just maybe VBScript is going to be the language everybody uses on the Web.

Dave Markle on May 22, 2007 4:57 AM

Javascript is awesome.
Running various random scripts on your local machine without your knowledge is silly.

Javascript created and continues this idea and expectation, so now it's difficult even to view many pages with out running a purposeless script.

jessta on May 22, 2007 5:36 AM

Dave Markle: JavaScript isn't so much ignored by ASP.NET as it is hidden. A lot of the ASP.NET controls have JavaScript in them to handle client side behavior, and ASP.NET AJAX uses it in addition.

What this means is that you cna get quite a lot done without writing actually writing any javascript, which is probably why I still suck at it. It doesn't mean it isn't being used, though.

Telos on May 22, 2007 6:08 AM

I recently discovered the wonder (and heartache) of working with JavaScript. I am simply amazed at all it can do...JQuery has to be one of my favorites.

Josh on May 22, 2007 6:11 AM

Javascript is a fine language. But a language alone does not a platform make.

Unfortunately, Javascript is usually paired with HTML. HTML is a confused Frankenstein environment that has suffered at the hands of history, committee and browser. It has a complex and largely unhelpful display model. FWIW, AJAX is just the latest in a long list of hacks for beating just a little more out of this dead horse. Perversely, the limitations of HTML have propelled Javascript's importance.

What does this mean for the future? Well, bad designed never stopped anything from becoming ubiquitous (e.g. XML). The sheer inertia of the of web will ensure a long life for Javascript and HTML. But, the web is also an eyeball arms race. And in that race, providing a superior user experience (not just visually appealing mind you) is a winning play, particularly in a world of 25 of everything.

That is why I am somewhat upbeat on tools like Silverlight and even JavaFX.


Grant on May 22, 2007 6:32 AM

I was just about to excoriate JS at the feet of self-modifying code (html markup, in this case), but Grant beat me to it. JS isn't really the problem; keeping track of exec and innerHTML and innerText (and so on), is.

BuggyFunBunny on May 22, 2007 6:48 AM

Why is everyone saying "The problem with JS is X" and "The problem with HTML in Y". What you're really finding are reasons for some undefined "bad concept" about JS or HTML-- it doesn't feel as nice or elegant or as powerful to programmers experienced with other systems. But take a frank look at the facts: every single computer out there has a browser with JS and DOM support (to one degree or another). Anyone can download a web page and view it. All you need to develop for this "platform" is Notepad and a browser. All other tools are truly optional. This is a big deal, there's really no other language/platform like that today. And I think this is the reason Jeff made this post.

Reed on May 22, 2007 7:52 AM

Silverlight 1.0 is of course implemented in... Javascript. :)

Also I have to agree with the NoScript boosters. I don't mind allowing sites to use Javascript after I see them and choose to allow it, but by default it's going to stay off.

Mark on May 22, 2007 8:38 AM

I very happily ignored JS for a long time.

Then recently I started on a project which uses Google Maps as part of the interface and had no choice but to learn at least some JS. It wasn't nearly as bad as I'd imagined.

JS had a well-deserved bad reputation for providing nothing much of value to the end user, but that isn't the language's fault; the blame lies with the people who abused it, and the Netscape/IE wars which crippled it's cross-browser compatibility for years.

The better executed "AJAX" applications have given it back some of its dignity and shown that it can, in fact, be put to good use in the right hands.

The major problems I have with it now are the tendency to have HUGE amounts of really badly written client-side code, sites which don't have any sort of graceful fall-back for users who don't have JS enabled, and the whole new breed of security problems we're going to encounter. But they're issues shared by any client-side solution.

Paul Glover on May 22, 2007 8:42 AM

Products like Adobe Flash/Flex have never tried to be like or replace Javascript. Javascript has always had it's place and "multi-media" plugins like Flash have had their place.

To compare them doesn't really make sense. You think Macromedia all those years was trying to compete against JavaScript? Haha silly rabbit no.

The only reason they are even remotely being compared now is because the rise of Ajax and hence the rebirth of JavaScript. JavaScript is just a language and Ajax is a technque or way of doing something. ActionScript is a language...and Flash is a yet another way of doing something. And yes, Actionscript is a sister language to Javascript because they are both ECMA script based.

Technologies like Flash still have their place in my opinion but re-thinking whether ajax could be better used is now a question I ask regularly. Although when the requirements are more multi-media, game like or experimental Flash can be used here or whatever current plugin is widely used and supported at the time.

Thanks,

-Ralph

Ralph on May 22, 2007 8:46 AM

[quote]
The problem isn't really JavaScript. The problem is web development in general. JavaScript is useless without an HTML page and the associated ugliness that comes along with it. I'm no fan of JavaScript but I'm an even lesser fan of all the crap that is "web development" today.

We need to just start over again. Until we do we will be living with the world's biggest kludge for the rest of our lives.
[/quote]

Amen brother. We've taken hypertext and built a massive environment on top of it. The foundation is quicksand. I can't avoid it, but I hate the myriad kludginess of web development. We all talk about good design, elegant code, etc.. and ignore the 500 pound gorilla.

Brad on May 22, 2007 8:47 AM

Although I've obviously heard of every gotta-try-this-JS-package out there, I have no interest in forcing users to opt in.

WRT the earlier comment on Rico, I went back and glanced at their homepage: openrico.org - if they can't even get that simple page to validate, why in the hell would I want to subscribe to their code?

Not to pick on them, I have a feeling they're not the only ones out there...

btw: I wish Crockford would setup a feed on his site. Is he still stuck in the 90's? j/k

BillyG on May 22, 2007 8:51 AM

Let's not forget about the other mode of Javascript avoidance - the server-side abstraction layer. GWT in JavaLand, Script# in DotNetsVille.

Kevin Dente on May 22, 2007 8:58 AM

Interesting post, and I agree with your general premise. But you've got it completely wrong when you list Flash Flex as JS "alternatives". The fact is that Flash Player is, in no small part, a JS runtime. JS is THE programming language for Flash and Flex, specifically v3 ECMAScript. In fact, not only is JS "the world's most ubiquitous computing runtime", Flash Player is the world's *most ubiquitous* ECMAScript implementation.

Furthermore, Flash Player is more ECMAScript v3 standard compliant than any browser implementation - most browsers are based on v2 of the spec. Mozilla and Adobe are working together on Tamarin runtime, which will implement v4 of the spec. So we're way out front in that respect too.

Andrew Shebanow on May 22, 2007 9:23 AM

The only real problem with JavaScript, now that it's finally getting the attention it deserves, is that it can make you lazy. Trust me, I know. For nearly five years, I almost exclusively used this language for all of my professional needs: on the browser side, on the server-side (as an ASP programmer) and for managing various Windows tasks and HTML applications. And I'm not even mentioning the Rhino runtime. Laziness may be a virtue, but too much of a good thing makes it bad in a way. For a long time, I never did serious programming in better respected technologies. Even though I strived to apply good development practices in my work, which I believe is more significant than large lists of acronyms to weed out bad developers, I couldn't help but feel almost mediocre when compared to my peers.

It's strange to see the world now embarking on a path I recently was in a hurry to leave mostly because its market value was starting to verge on the shockingly low. I don't know if I would repeat the experience. I mean, I believe in the potential of XUL (a productive way to write run-anywhere applications that can work together), jQuery (it makes everything so ridiculously simple!), the ECMA standard (which is being adopted by various applications) and, the way the language is evolving, all we would need for it to conquer the server-side is a good developer community. -- but who wants to be labeled as a JavaScript programmer?

The lure of JavaScript is so great now that, like PHP, HTML and CSS, JavaScript is becoming a kid's language. As professional programmers are now slipping towards the lower end of the middle class, it's those with the most wide-spread skills that will consider moving out from a profession they enjoy to cultivate -- that is, unless they're able and willing to hype themselves up to superstar status. In other words, JavaScript may well be a must, but it's better to bet a business plan than a career on it.

Luis' Parenthesis on May 22, 2007 9:37 AM

according to Securityspace.com, market penetration of JavaScript is below 60%, hardly ubiquitous:
http://www.securityspace.com/s_survey/data/man.200704/techpen.html


Since it is impossible to write JavaScript that cannot be hijacked I see no pressing need to use JavaScript regardless of a market penetration of 60%. Instead I remain a member of the "The Point and Click Preservation Society":
http://www.propylon.com/news/ctoarticles/031223_pointclick.html

tndal on May 22, 2007 10:13 AM

Personally, I like Javascript. It's fun to work with. It's sometimes a bit annoying, but I've yet to work in a language which didn't have it's annoying parts.

John F on May 22, 2007 10:53 AM

Mike, you're perfectly right, of course. My point remains that what happened to scribes thousands of years ago is now happening to programmers. Don't you find it strange how defined we are on the marketplace by the languages we use when it's those skills that go beyond mere syntax and grammar that makes professionals distinct from amateurs?

I expect, or rather hope, that with the democratization of programming, we'll come to value the craft over the command set, just as we've come to appreciate the work of writers that lie beyond grammar. On second thought, I think it's rather the work of designers who can manage some code that will be appreciated over the ability to program well.

PS: I threw in HTML and CSS for effect, as a way of saying that these technologies are all part of the same bag, just to make them look even more Fisher Price.

(And, yeah, I also felt like getting some frustrations out of my chest. Maybe I should have abstained...)

Luis' Parenthesis on May 22, 2007 11:26 AM

I just want to recommend a website. QuirksMode:

a href="http://www.quirksmode.org/about/intro.html"http://www.quirksmode.org/about/intro.html/a

AndresVia on May 22, 2007 12:12 PM

tndal, your link is a red herring. That's how many of the sampled sites USED the technology, not how many people use it or how many browsers support it.

Unless you're going to tell me only 10% of people can view iframes and css only has a 54% market penetration.

Baxter on May 22, 2007 12:28 PM

[quote]
The problem isn't really JavaScript. The problem is web development in general. JavaScript is useless without an HTML page and the associated ugliness that comes along with it. I'm no fan of JavaScript but I'm an even lesser fan of all the crap that is "web development" today.
[/quote]

HTML was designed to describe documents, not applications - the fact that Google Calendar can be written to that collection of ugly APIs points to the flexibility of the system. HTML's success can also be, in part, attributed to its ugliness; show me a binary format that accomplishes what HTML does and I'll......wait a minute, it doesn't exist. Web development is ugly, but until someone comes up with another "sweet spot" API that is visible to search engines and can reach anyone with an internet connection and a five-year-old piece of software known as "the browser", it's here to stay.

For more on this topic, you may want to check out this book:
http://www.amazon.com/Weaving-Web-Original-Ultimate-Destiny/dp/006251587X/ref=pd_bbs_sr_1/104-6382103-6883909?ie=UTF8s=booksqid=1179859065sr=8-1

[quote]
btw: I wish Crockford would setup a feed on his site. Is he still stuck in the 90's? j/k
[/quote]

As an FYI (and although it's not always directly related to Javascript), Douglas Crockford's blog can be seen here:
http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li

Geoff Moller on May 22, 2007 12:40 PM

JavaScript is our friend. I've spent many long, tedious hours pouring over JavaScript code developing new techniques and perfecting syntax. What have I gained from it? A rich user interface for my web applications that gets jaw-drop responses when I show it to customers.

Mattkins on May 22, 2007 12:54 PM

You can even write your server side stuff in javascript if you want.

https://www.zimki.com/info/whyzimki.html

thats a blatant plug by the way.

bob on May 22, 2007 1:18 PM

Ivan: "... and I'm sure you'll come to the conclusion that browsing the web with something like the http://noscript.net extension is the only way to go these days"

It's not XSS (I've never personally witnessed it anywhere), but it's the plethora of stupid "popups", scrollers, AJAX, this and that. It's absolutely horrible when you stumble upon a site which loads half a megabyte of memory-leaking, performance-reducing JS. Take your stupid gigantic JS libraries and shove 'em where the sun don't shine. I'm on a metered connection, damn it! You have 30 KB of content, and 300 KB of JavaScript -- I'm looking at you right now, f***in' Flickr! What do you need the JS for? What???

I have both JS and Flash globally disabled, and I enable them on a site by site basis. Maybe. If it's really, really important, and I cannot choose to ignore a particular site, as I usually do; the sure way to have me never visit you again is to rely on JS for your functionality. I even use Gmail with JS disabled, as I cannot stand the stupid AJAX stuff breaking my back button (that is, my mouse gesture). Oh, and Gmail loads and runs faster, plus is more user-friendly, with JS disabled.

People who have JS and Flash disabled are growing in numbers. Ignore THOSE people at your own peril.

Ivan on May 22, 2007 1:34 PM

You can even write your server side stuff in javascript if you want.

Um, you missed the boat by around a decade. Both Netscape and Microsoft offered server-side Javascript back then.

foobar on May 22, 2007 1:58 PM

Ivan: I would have to agree with the sentiment about browsing with flash and javascript disabled -- and only allowing on a per-site basis.

Dozens of sites *require* javascript for basic functionality, and don't bother degrading to GETs or POSTs. Laziness or evidence of this move to depending on the availability of javascript in the browser?

Haacked: I remember InterDev having a javascript 'debugger' in the style of visual studio. Hovering over variables to see their values and such.

opello on May 23, 2007 7:35 AM

"Oh and btw Javascript does 'work properly' its just some browsers handle it better than others..."

Like I said before, it's not JavaScript's fault. It can only provide the functionality that is agreed upon by the standards commitees which move at a snail's pace. It is crippled by the lackluster set of features available from the DOM provided by the likes of HTML.

For example, there is currently no simple way to determine which control on a page has focus. This is not a JavaScript deficiency. But it will take years before the w3c actually gets their act together to do something about it.

And this is another reason why commercial products like WPF/e (Silverlight), Flash, and others will always provide a much richer programming model than will JavaScript/HTML. If they recognize that something is missing they just add it in the next release. There is no one to quibble with and they don't need every browser maker in the world to add compliance. Sure, you must force users to upgrade to the latest version of the plug-in. But so far, Flash hasn't had any problems getting people to do that. People are willing to upgrade a plug-in. They are NOT willing to upgrade their whole browser or OS.

Matt on May 23, 2007 9:13 AM

Matt:
"People are willing to upgrade a plug-in. They are NOT willing to upgrade their whole browser or OS."

I would have to disagree. People are perfectly willing to upgrade their browsers. The problem is that browsers (particularly IE, but all browsers in general) don't get updated nearly often enough. And, as you said, there isn't enough reason to upgrade given how glacially slow the standards committees move.

I also like to say that I agree with several of the other commenters: JavaScript is a good language in its own right. But I cringe every time I have to use it because of the platform it targets. htMl is a MARKUP language; as Geoff said, it was intended to describe documents, not create dynamic interactive applications. JavaScript and everything that has come after it exist soley to transform html documents into something there were never intended to be. Do javascript/asp.net/ajax/flex/silverlight/etc work? Mostly. Will building rich dynamic interactive applications on top of a markup language ever be a good plan? Not a chance.

That said, its what we have, and its not going away anytime soon. But I am constantly on the lookout for the technology that is going to sink it someday.

David on May 23, 2007 9:45 AM

For the last 6 months, I have been working on creating javascript on rails. If anyone is interesting, we are planning on making the framework open-source. Check it out at:

http://scaffold.jupiterit.com

Feedback is greatly appreciated.

Justin on May 23, 2007 10:40 AM

On somewhat of a tangent, but for those looking for a cool Javascript IDE, check out Aptana, www.aptana.org - you even get Javascript intellisense!

It is coded in Java, so takes a bit longer to load, but still great to use. Just wish they'd get a color picker in there for CSS editing...

Sam on May 23, 2007 1:46 PM

http://blog.outer-court.com/archive/2007-05-23.html#n73

--
Andrew emailed this question: “What happened to the Google search engine last week, I can’t see the buttons for image and news what changed?” After we emailed back and forth, it turns out that for security reasons, JavaScript had been disabled in Andy’s browser. Without JavaScript, the corner navigation won’t load anymore (see screenshot). This seems to be a new level of inaccessibility in Google homepage designs, but then again, pragmatically speaking without JavaScript you just won’t get very far online in the first place these days...
--

Jeff Atwood on May 24, 2007 5:15 AM

I agree with Toni.

Javascript is off by default.

90% less security holes (if not 99.9%), no annoying sounds or animations on tacky websites and less ads. I save myself many problems by treating javascript like the plague.

Javascript has its uses, but I do not trust everyone to use it wisely.


--
Rune

Rune on May 24, 2007 12:42 PM

Just take a look www.extjs.com
It's the best JS library I've ever seen.
Not only wonderfuly UIs, but nice code!

Frank Cheung on May 26, 2007 6:00 AM

Oh I love javascript, big ups! Seriously. Dynamic!!!

Chris Anderson on July 2, 2007 12:56 PM

I still think the best way to do things is degrading javascript gracefully. Even if you are making a complex web application, you can still layout all your text and information, with regular links that will refresh the page to do what you want. Then go back and have javascript (in an external file) cancel those links' default action, and perform ajax routines instead.

For more information on how to do this, I also look at http://javascript.codeislogic.com/

Nick on August 3, 2007 10:39 AM

Thanks for the usefully informations

Werbeagentur on December 24, 2007 5:00 AM

Interesting! And Nick, thanks for the javascript Link :)
Many Gracias from Germany

Flyer on December 24, 2007 5:01 AM

Well I'm sorry to tell you that this can be applied to any language like Ruby, C#, VB.Net, c, etc. What needs to be considered is not the language its written in, but what is written.
http://pogonyaem.ru/

Olef on January 9, 2009 5:54 AM

What do you think about projects like Script#? Will it have a future? Check out Nikhil Kothari's blog http://www.nikhilk.net/ScriptSharpPastPresentFuture.aspx

Jon Trresdal on February 6, 2010 10:02 PM

Firebug's cool and all but it's not really a 'debugger' in any meaningful sense. Hasn't anybody used Venkman?
http://www.mozilla.org/projects/venkman/

James Stevenson on February 6, 2010 10:02 PM

"JavaScript is a hack to make the pages dynamic Ajax is a set of hacks built on Javascript to make it work "properly" ... sometimes" - Jaster

@Jaster: What are you going on about? Its hard to take your comment seriously it is so filled with inaccuracy.

"AJAX is a set of hacks built on top of Javascript", really what!?
Its a term used for a technique where a combination of languages (Javascript + XML) is used to create more responsive web applications.

Even tho the X in AJAX stands for XML it has also become the common name for this sort of technique (even if you use JSON instead of XML etc)

But it is most definitely not a 'a set of hacks built on Javascript to make it work properly' - What I think you are referring to is a Javascript library/framework (like prototype) which includes AJAX helper methods but whose main purpose is to provide consistent methods for performing common tasks with Javascript without the worry of cross-browser issues.

Oh and btw Javascript does 'work properly' its just some browsers handle it better than others....

Aaron Bassett on February 6, 2010 10:02 PM

Average people don't know the difference between the desktop and the browser, and now after a few years of the web experience they want the browser to act like the desktop. Just showing them a map isn't good enough any more. The map has to zoom, has to be able to be interactive, etc.

Therefore, the existing browser is *dead* in my opinion.

Technologies like Ajax, Javascript, just a bandaid. The solution is to evolve the browser into a virtual desktop and come up with a standard based libraries to what you can do in the virtual desktop. It like VMWare, but instead of an O/S, it's a window to the web, or a framework for the web. Whatever you want to call it, it's not a *browser* anymore with plugins to watch movies, etc.

Once this is done, you will be able to construct any type of application for the web, just like you do for the desktop. However, applications in the virtual space don't touch the base machine. Therefore, your registry doesn't become infected with spyware, no more dowloading conrols to your machine (still download in the the virtual space), no more propertiary scripting languages like VBScript, Javascript, JScript or browser support or any of that nonsense. Everything happens in the virtual machine and there is a boundary between the virtual world and your physical machine.

It's amazing to think after 10+ years of web application we are still scripting solutions for it.


Jon Raynor on February 6, 2010 10:02 PM

The comments to this entry are closed.