Why I don’t like widgets

The reason is really simple – they’re bloated. Widgets is another word for a huge javascript that does what you want/need and a whole other stuff somebody needed or maybe just the developer thought somebody would someday need. Usually the javascript is so ‘complex’ that you can’t just remove the stuff you don’t need – it’d be faster if you wrote your own.

There is another reason that goes beyond javascript. Most widgets don’t exploit the technology and go about reinventing the wheel which results in crappy/invalid HTML, problems with data persistance and a low level of pluggability. Some actually do use an API but I think that’s overkill.

It’s funny what wikipedia says about widgetsclearly, they represent any purely mercantile commodity that has no artistic or spiritual value. When I first started writing the SortedTable I wanted to accomplish the contrary. I tried to write something that would exploit the advantages of valid XHTML and the fact that you can nowadays rely on DOM functionality of the browser. I did it for me and not for money (and released it under CC license).

The problem is I got many feature requests, that could simply be accomplished via some DOM scripting and using the built-in event handlers. I decided to keep the script simple and display the possibilities through samples. What needs to be done next is the reimplementation of the sort function which is a bit slow – I already have an old implementation of Quicksort in javascript that is going to come in handy for this one.

Anyway, a new version is out. This is the changelist:

  • corrected a weird error that broke some sorts in ie6
  • added the possibility for a nonsortable column via class=”nosort” on the th cell
  • added the possibility to ‘regroup’ tbody elements if there’s more than one (for whatever reason)
  • added additional hook to put your custom javascript on (onsort)

One Response to “Why I don’t like widgets”

  1. Marko says:

    Hear hear. Pages should be lean, mean and bite.

    I do expect widgets to flourish and I can’t say it’s all bad. I expect, in time, they’ll enable more people to use Javascript in more reasonable ways than otherwise.

    Of course, they’ll also let more unrestrained souls do new horrible things.

Leave a Reply