Back from my holiday to sunny Lanzarote and still wandering around in sandals hoping London starts to warm up.
But back to business…
A recent theme for me is: ‘time saving’ frameworks, wasting my time. The Rails movement has had great success with the prescriptive data layer and recently Microsoft Atlas has jumped on the drag and drop AJAX bandwagon. I’ve used many others but Data Binding is the greatest of these bastions of pain wrapped in hope.
It always starts the same. Flashy Data-Binding demo; click, click, click and your DB table is a HTML table… WOW that’s great. So you try it out and hey-presto the demo works for you too… WOW that’s great. So you start building strongly typed dataset or transfer objects so that the click, click, click bit still works. And hey, now you have a handy way of structuring your data. You’ve got 2 copies of your data structure but that’s OK, you still have a warm fuzzy feeling from the first WOW.
So now you start binding your table. But real world tables aren’t like in the demo. You need custom formatting so you learn the magic binding syntax great but now you have procedural code in your mark up… Darn. You need more that alternating colors, that’s tricky… Darn. You need complex content in a cell so you need the ‘more generic’ template column but then getting hold of the contained controls is fiddly …Darn. You want to light the rows up using CSS alone so you finally have to fall back on the ‘more generic’ Repeater. But hey you can’t expect a framework to do everything right? But now you start realizing that it’s been a long time since the first WOW and your deep into ‘Darn’ territory.
Cut to a few weeks later …
Everything is difficult, you can’t find where things are done, you’ve used so many hacks to get around the foibles and inconsistencies of the Data-Binding framework that no two pages work quite the same. You’re fearful of touching anything in case it blows up. Even having giving up on some features because they just didn’t fit, you’ve booby trapped yourself into paralysis and you long to throw away all the code…
Repeat as needed.
Now I’m not saying that there is no value in Data-Binding. But the big question is: why? Why use Data-Binding at all? The ‘hello data’ demo looked good, but that’s because it used intelligent defaults to make it look smarter than it truly was. And what did it do for you? Mainly: Assignment in a loop. In retrospect typing foreach a couple of times no longer looks very taxing.
The moral? You can’t get away without using 3rd party libraries. But be careful to choose the ones that solve real problems not the ones with the best 3-minute demo.