Unix Review > Archives > 2006 > November 2006
Print-Friendly Version

November 2006

An Imagined JavaScript Conversation

by Cameron Laird and Kathryn Soraiz


--Yes, JavaScript. You know, we seem to have this same conversation every couple of years. Yes, I wrote it all in JavaScript.

--OK, I know it's improved a lot ...

--That's the first thing: JavaScript really hasn't changed as a language since the ... well, the twentieth century! It's always been capable of a lot more than its common uses; it's just that the motivations and habits of its user community are different from those of, say, Haskell .

--Hmmm; if it's always been such hot stuff, why have I been hearing so much more about it this year?

--It's like any interesting story: a combination of history, dumb luck, individual choices, corporate fashions, technical realities — the usual suspects. There's the whole AJAX thing: JavaScript could support useful client-side network callbacks nearly a decade ago, but the browser environment didn't catch up until, let's say, 5 years ago. Google Maps make a very effective advertisement that "Web desktops" can be practical, and thousands of experimenters are trying out AJAX for themselves.

--What I like best about it is that I don't have to think; I just use MochiKit or another language wrapper to protect me from all that.

--Sure! You can do that; for me, the real point is that AJAX passed some sort of threshold in '04 or '05, with a rich enough environment of adequately correct browsers, JavaScript libraries, documentation — and enough memory in common hardware — so that there are useful entry points all up and down the hierarchy. You can find a reasonably mature toolkit that lets you focus on the visual decorations you need, and I can program in the "lightweight" style I want.

--What is it with you and "lightweight"?

--I'm not entirely sure, in fact; I just know this is what's working for me now. I get to do mind-blowing stuff ... Look, you can buy a tiny box that runs on a few watts (!) and is conveniently programmable as a vanilla Linux host. With even a half-baked solar or compressed gas or other power supply, I can drop one of these in the middle of nowhere, reach civilization through a GSM link, and report back on system pressure or pollutant levels or predator movement or whatever as conveniently as the stupid "pageview counters" everyone was writing in '94.

--What's that have to do with JS?

--Oh, right; nothing necessary, but JS is just a convenient answer. Look, I'm not trying to engineer a Mars Rover; my approach now is to put together commercial off-the-shelf pieces, like GSM cellular handsets, ARM-based hosts, and so on. I've tried all kinds of networking, and AJAX-ish architectures just give me the right combination of rapid development, scalability, maintainability and reliability for this line.

--OK, sure, so it's been beefed up with all this good modern stuff, but why saddle yourself with a toy scripting language?

--You know, I owe you; I really need to get you to see JS for what it truly is. Pick up Shelley Powers' latest book , and you'll learn the basics of JS as a language. It's an interesting language; it fully supports good object-oriented coding, and people write serious projects in JavaScript. There's a whole parlor game of writing JavaScript interpreters in Lisp or Python or other languages, Scheme or Forth or Prolog interpreters in JavaScript, and so on. I can run standalone JS with spidermonkey, I can write sophisticated small processors, and, in a browser-dominated world, assume instantaneous deployment. Oh, I'm getting off the subject. Read Learning JavaScript, and you'll pick up the essentials about AJAX, DOM, semantics, prototyping, CSS, DHTML, security, and libraries, so you can judge JS for yourself. The book has rough edges — typos, and occasional explanations that call out for editing — but it's got the right attitude, and you won't bog down in all the cosmetics that are the point of almost every other JS book.

--Well, maybe. Will I ever use this stuff, though?

--Beats me. Maybe not. Put in a few hours, though, and you'll at least be arguing from the facts next time you try to tackle me on the subject. I think you'll find you like it, though; there are just too many effects customers are coming to expect that are way easier with JS. Learn the basics, and have a surer foundation the next time you argue a design decision. Oh, and one more thing: read through the comments of "Six JavaScript features we do not need ... ", just to get a feel for how experienced people think about JS. You'll be glad you did.

Kathryn and Cameron run their own consultancy, Phaseit, Inc. , specializing in high-reliability and high-performance applications managed by high-level languages. Cameron has published in and about JavaScript since its 1.2 release, and the language occasionally shows up in these "Regular Expressions" columns.

Sys Admin Spotlight

CMP DevNet Spotlight

Programming for Reliability
Lessons learned from static analysis of millions of lines of code

In the News

Verizon Wireless Helps Vodafone Turn A Profit Corner
Vodafone executives are now interested in adding to its ownership stakes in ventures in Europe, Africa, and Vietnam.

Texas Instruments To License Certicom Technology For E-Passports
TI will use Certicom's Elliptic Curve Cryptography technology to enhance security on new government-issued electronic identification.

Microsoft MAR Takes A Half-Step

The first comments posted to last Friday's story about the Microsoft Authorized Refurbisher (MAR) licensing program were of the “Microsoft is screwing us again” variety. That doesn't seem to be the case, but there are other reasons why the idea of a new license for old hardware doesn't make much sense.

Nokia Goes For High Style With 'Arte' Mobile Phones
The phones also come with a hefty price tag: The Arte will cost about $1,460 while the Sapphire Arte will cost around $1,680.

SMBs More Concerned About IT Spending Than Productivity
Thirty-seven percent said controlling IT budgets was their top concern, while 23% said using technology to increase worker productivity.

Social Networking With A Point

Is there a real point to social networking? It is a lot of fun, and it can be a useful way to establish contacts. But it's usually a black hole of time -- a lot of chat without a lot of substance. However, there's at least one new site that's trying to offer social networking with a social conscience.

HP's Hurd: Software Industry Consolidation Could Accelerate
"How fast will the consolidation occur?" HP's Mark Hurd asked. "It could happen fast, if the right alignment of players occurs."


Sys Admin and The Perl Journal CD-ROM version 11.0

Version 11.0 delivers every issue of Sys Admin from 1992 through 2005 and every issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!


Try VMWare Workstation for Free! Register here.
VMware Workstation: The gold standard in desktop virtualization. Click here for your free trial.

Get your FREE 30 day VMware Workstation trial Now!
Virtualize your desktop today with VMware Workstation.

Easy & Powerful Server Monitoring that Just Works
Fortune 500 clients include Financial, Healthcare & Telco Companies. Free Trial Download.

MS Office Accounting 2007
Easy to use award winning software. Buy Pro version for only $149.95!

Wanna see your ad here?