Inside SWT

Saturday, November 29, 2008

Smog Computing

Announcing smog computing! I don't know about you, but I'm heading for the clouds. Enough computing on earth. The bits are much more delicious here in the stratosphere. Up here, a guy can really click on a button. It's different. It's better.

Now to get here, I had to endure fog computing. That was me, in a fog, wondering where everything was. Where are the class hierarchies? Where are the visibility rules? Where are the components? But the fog cleared ... and here I am (cough, cough).



Listen up ground dwellers, Douglas Crockford says, "I have been writing JavaScript for 8 years now, and I have never once found need to use an uber function. The super idea is fairly important in the classical pattern, but it appears to be unnecessary in the prototypal and functional patterns. I now see my early attempts to support the classical model in JavaScript as a mistake."

Steve

9 Comments:

  • That reminds me of object oriented assembly.

    All that trickery makes me feel sick. We should have learned by now that stuff like that, even if a bit amusing, just gets us into trouble.

    By Anonymous Anonymous, at 11:27 PM  

  • Imagine vaporware made from real vapors you can actually see and smell. You'll cough up a lung with excitement.

    By Blogger Ed Merks, at 8:44 AM  

  • But Ed (cough) (cough), there's real code up here (cough) (cough) and different models of computation to be embraced.

    By Blogger Steve, at 11:02 AM  

  • I don't understand.

    By Anonymous Anonymous, at 4:05 AM  

  • Hi Anon-y-mouse!

    Cloud verus Earth, in the end, it's the same old crap (ie. create a button, add a listener, do something) (cough) (cough).

    I realize that while cloud computing doesn't necessarily imply JavaScript, you will hit it while there. A small amount of code is almost never a problem but what happens when you have a lot? How do you integrate with others? Traditionally, this was managed by class hierarchies, packages and visibility rules among other things. Many JavaScript widget libraries implement these concepts since they are not built into the language, hence incompatibilies, multiple ways to do things, etc. (cough) (cough)

    Question: Should you embrace the new order or attempt to adapt old patterns? A recognized expert in the field, Douglas Crockford thinks you shouldn't. Advocates of ActionScript and .NET believe you should and have added them to their languages.

    It's smoggy up here in the clouds.

    By Blogger Steve, at 11:49 AM  

  • Crockford explains his method in a page about prototypal inheritance. His final recommendation is familiar to anyone who's seen object systems in Perl, Lua, Scheme, et cetera -- where the syntactic tedium of sugarless inheritance is balanced by the lack of use cases where inheritance is appropriate.

    Since we're favoring composition over inheritance nowadays, Crockford's comment on uber/super isn't really of much significance.

    Re: vaporware -- I don't know, there are four different browser-hosted implementations for JavaScript, representing over 99% of web client-side programming. It seems a little odd to somehow pile on it now when the ship has sailed.

    If you're curious about the current direction of JavaScript, the post about ECMAScript Harmony may shed some light on the subject. Packages and namespaces are out; syntactic sugar for classes is in.

    To me this looks like the opposite of vaporware -- it looks like trying to move a language forward when it is already a victim of its own success.

    By Blogger Steven Huwig, at 8:14 AM  

  • Thanks for the links Steven. I didn't say anything was vapour and acknowledged that there are different language/computing models to be embraced. I wonder if they will hold for the kinds of large applications that we are building today using classic techniques.

    By Blogger Steve, at 1:12 PM  

  • The model is not much different from other dynamically typed procedural languages with objects and/or lexical closures -- it's just a matter of spelling.

    Now Haskell, that's a bit further afield...

    By Blogger Steven Huwig, at 2:38 PM  

  • Yes, I know about dynamic languages and lexical closures. Languages such as Smalltalk, Scheme and JavaScript are so maleable that it is tempting to mutate them like Doug Crockford did (and later regretted doing) into something unnatural.

    Experience building large Smalltalk systems showed that it was possible (and fun) but that lack of modules and API enforcement caused integration problems.

    By Blogger Steve, at 4:18 PM  

Post a Comment

<< Home