The Web Dev Zone is brought to you in partnership with Mendix. Discover how IT departments looking for ways to keep up with demand for business apps has caused a new breed of developers to surface - the Rapid Application Developer.
Programming and Your Brain
The talk was inspired by the book "The Science of Fear", which hypothosizes that the brain, in simple terms, can be divided into two parts: the "Head" and the "Gut". The Head is where our logic and rational analysis comes from, and the Gut is supposedly evolved from our 'fight or flight' response, which means it's very fast, and can often overpower our more rational Head. This is how, for example, advertising can tend to work against our better judgement.
How we program with the help of our "gut"
- It brought Lambdas into the mainstream of programming
"Programs are one of the most (if not the most) complex things that humans make," said Crockford. "Programs need to be perfect, but humans are not good at perfect." Crockford believes that if humans had no "Gut", they'd never release software, because software (along with the languages that it is built on) can never be perfect.
- Always use ===
- Avoid multi-line string literals
- Global variables are evil
"It will make you cry," Crockford said in reference to JSLint. "I've literally seen people cry after using it."
Douglas Crockford: The Good Parts
Now to the part where he answered some of the audience's questions, and mine.
Next, we got his opinion on node.js - which he thinks is "brilliant." He said that Yahoo's YUI 3 library now runs on node.js. It gives you a lot more options for where to run things (server or client), so that you have the best performance, whether it's Chrome 13 or IE7.
Crockford also says that he'd like to see more cooperation and integration between the efforts of the W3C and the ECMA steering committees. Unfortnunately, the two sides have had one meeting in their history and it didn't go well. The ECMA committee is willing, but the W3C doesn't see the need to synchronize. Crockford believes that the browser is a horrible model, mostly because of the W3C.
Here were the questions from me that he answered:
DZone: We're in the early stages of a new revision for ECMAScript called ECMAScript.next. What has your involvement in this revision been in this standard revision and what are a few of the ideas that you are excited about? What's the latest you've heard about its progress?
Crockford: I represent Yahoo! at ECMA TC39, the committee that is the steward of the ECMAScript standard. There is a lot of interesting stuff proposed, but I am not certain what will make it into the next edition.
Crockford's New JS Benchmark and IE10
DZone: I think it was in April when you released a new JS benchmark (JSMeter?). Could you tell me a little about the benchmark (perhaps in comparison to the incumbent SunSpider) and why the IE10 preview ended up being the fastest? Is Microsoft finally on the right track with IE?
I am impressed with what Microsoft has done with IE10. I hope it quickly replaces all of the earlier, awful editions of IE.
DZone: Any thoughts about "Cloud" or web-based IDEs, like Mozilla's Skywriter (formerly Bespin?)
The most interesting feature of the so-called HTML5 collection is the Canvas, which allows us to abandon HTML entirely, avoiding the DOM and building our own displays out of pixels. This demonstrates how misfeatured the DOM is. The DOM needs to be replaced. It is slow, poorly specified, inconvenient, and insecure.
DZone: Finally, what did you think about the news of Google's new "Dart" language to replace JS?
Crockford: Google has not shared any information with me. Of the little bits they have leaked, some of it looks good. Some of it looks very, very bad. It is too early to draw any conclusions.