By Kevin Yank

Douglas Crockford on Web Standards and JavaScript

By Kevin Yank

Douglas Crockford at Web Directions South 2008

I became a bit of a JavaScript fanboy while writing Simply JavaScript last year, so it was especially thrilling to get to sit down with Douglas Crockford—possibly the world’s biggest JavaScript fanboy—and geek out on our mutual love of JavaScript at Web Directions South 2008 a couple of weeks ago.

One of the most amazing things about JavaScript is that such an elegant, subtly powerful, and forward-looking language could have been born of the fiercely competitive innovation of the so-called “browser wars” of the mid-nineties. Really, all Netscape needed to get ahead was a simple scripting language to run in its browser, but somehow what it ended up building was this amazingly capable little programming language. I asked Douglas Crockford how this happened:


They were really lucky. Given the process that created the language, we should have gotten something much, much worse, because they didn’t do a careful design of requirements. They certainly didn’t give enough time for its design or its implementation. They took a prototype, which was intended just as a proof of concept, and that’s what they shipped. And it had all the problems that you would expect such an implementation to have. That’s what we had. And it was partly on the basis of that implementation that the language got the terrible reputation that it had. And a lot of those defects are still in the language.

In his talk at the conference, Crockford had outlined a number of fundamental security problems that he would like to see fixed as JavaScript moves forward. Problems aside, perhaps JavaScript’s greatest strength as a language is how accessible it is to beginners.

As JavaScript moves forward, I wondered, would we be able to preserve that low barrier to entry that makes JavaScript something you can pick up as your first language and feel confident after just a day or two?

I think so, and I think we need to. I think we would be making a tragic mistake if we didn’t retain the language’s simplicity. Most of the modifications I would like to make in the language would be to make it even simpler. There’s some cruft on it, there are some attractive nuisances in it, which we don’t need, which people become dependant on. We’d be better off without that.

Unfortunately, the thing about the Web is, once something bad gets in it, it takes years to get it out. Ajax didn’t happen until 2005, but all of the technology that we needed to do Ajax was in place and in the field in 2000. Most of that five years was spent removing old browsers from the marketplace until there was enough of an audience on IE6 that Ajax became a viable application platform.

The main set piece of Crockford’s talk was the story of how he became convinced that a second “browser war”—as scary a prospect as that might be—was exactly what would be needed to kick the evolution of JavaScript and the Web back on track.

Fundamentally, Crockford believes, web standards have failed in their attempt to lead innovation on the Web:

For example, CSS2 was un-implementable, and eventually it had to be revised as CSS2.1, which was an attempt to cut CSS2 down to what people were actually able to figure out how to implement. That sequence was totally backwards—or it started backwards, but eventually they got it right. Let’s look at what can actually work and make a standard out of that, and then let everybody catch up with each other. I think that’s a proper role for standards.

What I see happening now with HTML5 is appalling. There is some stuff there that I really like: I really like that they figured out what the rules of HTML parsing are. Brilliant. That’s long overdue. And you can look at any individual feature that they’re doing and say, “Yeah, that makes sense.” But there’s just too much stuff, and there’s not a good set of tradeoffs, there’s not a complexity budget. It’s not motivated by real need, it’s more motivated by what’s shiny in front of a committee.

So, I would like to find a way to inject more discipline into the process, and I think one way to do it is to change it to an evaluation and description process, where we’ll observe what’s going on out in the wild, and document the best of it.

Read my full interview with Douglas Crockford at

Image credit: Web Directions

  • Randy Zagar

    I fail to see how web standards can “lead innovation on the Web”. Standards are created after you figure out how to reliably do a new thing. Since doing a new thing is “innovation”, trying to make standards “lead innovation” is very much putting the cart before the horse.

  • I wondered, would we be able to preserve that low barrier to entry that makes JavaScript something you can pick up as your first language and feel confident after just a day or two?

    I find this statement a little hard to swallow :-) I teach online courses for novice programmers and I would say that client-side Javascript is a really bad language to start with. Admittedly it’s C-style syntax, which will come in useful later, but the big problem IMHO is browser incompatibilities; you can get it working in Firefox for example, and then discover it’s broken in IE, or vice versa. This is very dispiriting for newbies. Many students give up in despair, because they can’t understand it — when they would have had a much easier time with PHP, for example.

    “Comfortable in a day or two”? I’ve been programming for 20 years and I’m still not comfortable with Javascript — though admittedly I haven’t tried very hard ;-) I’ll be happy if someone can convince me otherwise!

  • Caligula

    @veronicay: JavaScript-the-language is cross-browser enough that you can accomplish quite a lot of education. Browser incompatibilities rear their head when dealing directly w/ a few DOM issues.

    Throwing a reasonable JavaScript library removes that issue, and can be a good way to introduce some of the more advanced capabilities at the same time.

    It’s not the language *I’d* choose as a first language, but browser incompatibility wouldn’t be the reason why.

  • Thanks Caligula — I freely admit I haven’t spent a lot of time really getting to understand JS, but then my point was that 2 days isn’t enough :-) Even leaving aside browser problems I have just never got comfortable with it. I know I should look more closely at some of the popular libraries that make life a lot easier — I’ve dabbled with Prototype but only enough to accomplish a few specific tasks.

    So why wouldn’t you choose it as a first language? :-)

  • blacklight

    One of the strengths of javascript is the way it can be functional (think c) and object oriented (c++) at the same time. It also treats every object and its members as a key/value associative array (think hash or map).

    A good example of that is this Drag and Drop DHTML Dialog. Its pretty cool. It is a total crowse-browser compatible drag and drop interface. An example is given with a simple dialog box. But it is written in object oriented javascript, which makes easy to reuse (namespace collisions etc).

  • pd

    I could not agree more that the standards development process is a failure.

    Why don’t those responsible for standards take a tip from the industry they operate in – software development – and release smaller, more concisely defined, standards as ‘point releases’.

    The one thing the web is currently crying out for is better form controls. Look at all the JS libraries trying to hack controls like sliders, drag and drop, file upload, the list is long! These should be provided natively by the browser.

    It is comical to babble on about the web as a developer platform that can compete with the desktop until these controls are mature and ubiquitous.

    Unfortunately attempts to implement such simple improvements to the web get gobbled up by glitzy crap like SVG, Canvas (two drawing APIs for the web when arguably we don’t need one (yet)!) etc.

    Xforms? Web Forms 2? Irrelevant! Get the damn controls in the browser! NOW!

    When standards development is too slow, cut the crap and innovate!

Get the latest in JavaScript, once a week, for free.