December 2006

The Technology Adoption-Standardization-Prevention Cycle

I’m trying to optimize my google reader experience, and fly through feeds as effeciently as possible. For me, this means keeping my hands on the keyboard, and off the mouse. Reader uses the j/k keys to go up and down, just like the classic game nethack, and the Unix editor vi. I’m amazed that twenty years on, we’re still using this interface. I suspect that when the time comes, I’ll be lowered into my grave by an operator using the j and k keys.

Anyway, google uses the “v” key to view an article in full. This comes up either in a new window or a new tab, depending on the firefox configuration. Sadly, if you want the article in a new window (and I do, seeing as I paid good money for a large amount of real estate), firefox’s popup blocker blocks it.

So, the technology progression was — Netscape invented the pop-up window, the various web standards bodies standardized it, the advertising people abused it, so pop-up blockers were invented to prevent it from working in most cases. I wonder at the aggregate amount of engineering it took to come full circle. In 1936, J.M. Keynes suggested that it would be economically useful to pay otherwise unemployed workers to simply dig up bottles filled with cash, which other workers had earlier buried for them. Seems like we’ve got a high-tech equivalent going on now.

One Step Forward

Comments (1)

Permalink

Simple Good, Complex bad… Or Vice-Versa?

In a recent article, Joel on software claims that simplicity is overrated, that users want more features, and the single thing his company does to drive more sales is to release a new version of an existing product with more features. What’s notable is that a week earlier, he wrote this well-circulated post lambasting Microsoft for having too much choice in the shutdown menu in Vista, and advocated for a simple, one-button shutdown solution.

Continue Reading »

Marketing

Comments (1)

Permalink

Foolproof AJAX Progress Indicator

spinner Bruce Williams is right on in Avoiding AJAX Faux Pas where he lists four inviolable conditions your AJAX code must meet. The first two conditions address the need to show (then hide) a visual progress indicator to let the user know that a network operation (XHR) is occurring. These are important rules. Unfortunately, the implementation he presents is fraught with difficulties.

Bruce’s solution is comprised of a Ruby function showing_progress which he suggests you use in every single call to (insert_html, replace_html, replace) to wrap any options you’d normally pass to those routines. The showing_progress routine adds :loading and :complete handlers that will show, then hide an element with id ‘progress’ on your page.

The solution is kind of elegant and it works as advertised but I ran into a few problems as I got deeper into my app:

  1. I forgot to call showing_progress in new invocations of insert_html, replace_html, replace — as a result I didn’t get progress indication in those cases
  2. The solution works only for Ruby RJS code — if you write JavaScript that calls Ajax.Request and Ajax.Updater then the solution of course doesn’t help.
  3. The solution ruthlessly overwrites any :loading and :complete handlers you’ve defined in your options

How about a solution that works for both Ruby and JavaScript? It’d be nice if it didn’t rely on the programmer remembering to call it everywhere? It’d be even nicer if it didn’t interfere with your application’s :loading and :complete handlers.

Here’s the solution I’m using. I don’t recall where I first saw it but I’m pretty sure I didn’t invent it. I see Nicky Peeters was suggesting a similar thing over a year ago. Just put this code in application.js:

    1 Ajax.Responders.register({
    2 onCreate: function() {
    3  if($(progress) && Ajax.activeRequestCount>0)
    4  Effect.Appear(progress,{duration:0.5,queue:end});
    5 },
    6
    7 onComplete: function() {
    8  if($(progress) && Ajax.activeRequestCount==0)
    9  Effect.Fade(progress,{duration:0.5,queue:end});
   10 }
   11 });

And stick something like this in your layout:

    1                 <span id=progress style=display:none;>
    2                     <img src=/images/busy.gif>
    3                 </span>

And you’ll have one less worry in your life.

AJAX
RJS Templates
Ruby on Rails
script.aculo.us

Comments (2)

Permalink