Why javascript popups are bad

Do you know what happens when bad design happens to big companies like Google?... Widespread bad design!

It is a bad design when the interface does not communicate naturally. Will any sane person answer a yes/no type question with ok/cancel? Just imagine... you are in a hotel and you ask the waiter "Do you have cold water?" and instead of "No, I am sorry." answer comes - "Cancel"! And that, my friends, is the problem with these dialogue boxes. For example, check this blogger example.

Original blogger dialogue box.
Why the names on the buttons have to be so meaningless that you have to explain which button does what? Won't we be better off with more natural dialogue boxes like the following (hypothetical) one?
See that? Crisp and clear!

Sounds rosy, but there is a gotcha! The javascript confirm(), alert() or  prompt() functions DO NOT have any functionality to do this. Given that javascript functions can take any number of arguments, I fail to understand why browsers have not implemented these function in a manner that confirm("message") will bring up a dialogue box like the one shown in the first picture while confirm("message", "message_on_button_which_returns_true", "message_on_button_which_returns_false")
will bring up one like in the second picture.

Another bad thing about these built-in dialogue boxes : What happens when the user clicks on the close button? Why should the user be even presented with an option which is ambiguous and plays no role? You want an answer from the user, right? Then why give him an option to say "shut up"? That too, the user won't be clear what exactly happens when he says "shut up". Also, if not just the labels of the buttons, but also the number of buttons were customizable, one could have added "Save changes and navigate away".

But no! Why would the browser people who implemented the functions like confirm() want the web-developer's life to be simple? Simple, clear, unambiguous is evil, isn't it? Now is the age of complex, cryptic and ambiguous! If every damn grandfather and housewife out there finds it easy to use computers, how miserable the world would become!

So if you want to follow good design, don't want to write your own dialogue box code and don't want to use popular UI libraries like JQuery-UI , then you have no other option but to bang your head against a wall!

After getting fed up with the default, unnatural, stupid javascript dialogues, people found out new ways... JQuery-UI is one such example. These new libraries gave people freedom to give meaningful names to buttons, and the result?... Not very good! See the following custom dialogue box on Gmail which, simply follows the good old "ok/cancel" way (even though these boxes can be customized).
Why not "Discard" and "Don't discard"?

When gmail does it, blogger does it even worse, then whom will new web developers follow? Don't be surprised if tomorrow some web developer takes a cue (a rather wrong and funny one) from "It's ok to say 'No'" and greets you with the following dialogue box!

Update (11 Oct 2011):
Karthik Pointed out a very funny confirm box on Indian Railways Reservation website. Here is a screenshot...

1 comment :

  1. ThalaivarMax!!

    Your blog posts seem to heat up day by day! :-)

    All the euphemistic near-profanity and angry words seem so much in contrast to our sweet old SujeetMax (of course, it does bring back memories of ALL the times when a Prof gave a wrong explanation and you went *ballistic*!)

    Anyway, you may want to check out this blog / book (esp. Ch 5 and 6) -
    http://www.joelonsoftware.com/uibook/fog0000000249.html

    It's a basic guide to UI design. The guy's pretty famous in programming circles.

    Cheers,

    Reply Delete

Post a Comment

Note: Only a member of this blog may post a comment.