Even though the author didn't like it, I quite liked the ultra-chaining approach presented. So what if the readability relies too much on indenting, practically every language relies on indenting for readability (or the indenting actually has syntactical meaning like python).
Frankly, I found this example very neat and would love to see this in jquery.
$('div')
.when('click')
.addClass('active')
.text('Hey')
.done()
// Also possible with on()
.on('mouseout')
.removeClass('active')
.text('Ho')
.done();
It relies on indenting for readability, just like everything else. I say go for it!
Frankly, I found this example very neat and would love to see this in jquery.
It relies on indenting for readability, just like everything else. I say go for it!