(2006-10-02) Yegge Java Script Mozilla

Steve Yegge on developing with JavaScript and Mozilla. JavaScript is probably the most important language in the world today. .. For one thing, despite JavaScript's inevitable quirks and flaws and warts and hairy boogers and severe body odor, it possesses that magical property that you can get stuff done really fast with it. JavaScript is definitely the tortoise to Java's hare... It turns out if you dig deep into Mozilla (aka Netscape, aka FireFox, aka Sea Monkey, aka Swamp Monster, I mean the thing really has way too many farging names already), you'll find that it actually is a relatively full-featured Platform. It's not quite as general-purpose as an OS (or Java), but it's certainly big and hairy enough to be making threats in that general direction. But my God, it's sooooooo ugly. It's got well over a decade of ugly packed in there. "HelloWorld" in Mozilla is six or seven files in as many different languages... OK, but what about FireFox? Why don't they, you know, innovate? Well, they're trying, I think, but for what I'm guessing are probably tangled historical reasons - which manifest as the developers often being gridlocked politically - Mozilla lacks what Fred Brooks Jr. calls "ConceptualIntegrity" in his classic "The Mythical Man Month". (Which, incidentally, remains today the most vitally relevant book on software engineering, over 30 years after it was written.) The Mozilla folks would have to do a lot of serious re-thinking in order to reduce XUL's "HelloWorld" down to a few lines of code in a single language. And I'm not convinced that kind of thinking is happening in the FireFox camp right now. It's not that they're not thinking at all; don't get me wrong. They're just not thinking about radical, revolutionary user-level simplifications to the basic framework.

Ruby On Rails - now that's the kind of simplification I'm talking about. Screw all the XML minilanguages (XUL, XBL, Xx L). Screw the RDF. You need to be able to do everything in JavaScript. JSON is just good enough and parseable enough and language-interoperable enough to replace all of them. For that matter, screw CSS. I don't mean the CSS spec, not the relatively elegant constraint system they have in place; I just mean the CSS syntax, since it's one more language piled onto the heap... I mean, I'm all in favor of MVC, but I think Common Sense and its kissing-cousin Conceptual Integrity will both tell you that M, V and C don't need to be three separate languages. And the manifest and build information needn't be a fourth and fifth, respectively. And i18n a sixth. And the XPCOM system services an effective seventh. And the server-side languages Nth through Zth. It just doesn't make any sense.

So as soon as "Scheme on Skis" or "JavaScript on Jets" or whatever comes along, that Ruby On Rails-like radical simplification of the huge ugly Browser Swamp, the game will change almost overnight. I'm not sure exactly how it'll pan out. Rails is basically a big code generator, a big compiler, in a sense. The "language" is Rails itself - there's precious little actual Ruby in a Rails app, surprisingly enough, although there's tons underneath - and the target platform is the Browser Swamp... The alternative to a Rails-like multi-language hybrid is to do the whole ball of wax in a single language. Lisp and Scheme folks have, of course, warmed to this idea, and they all write macros that generate HTML (instead of a Template System), which winds up being way cleaner than you might guess. The GWT is one, of course, but you'd have to be a pretty doggurn die-hard Java programmer to go that way. I'm sure it'll improve with time, but the biggest stumbling block, amusingly enough, is that it's not JavaScript. JavaScript is still King in the browser space, and ironically it's like programming to the "bare metal" compared to using a Java-to-JavaScript compiler. So JavaScript is what the "real" web programmers prefer to use. Hmm, how about Python-based PyJamas 2006-11-21-TauberPyjamasAjaxPython for AJAX?


Edited:    |       |    Search Twitter for discussion