Beautiful JavaScript by Anton Kovalyov

Beautiful JavaScript by Anton Kovalyov

Author:Anton Kovalyov
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2015-08-15T04:00:00+00:00


Backbone

Dojo changed everything for me; Backbone changed everything for everyone else. While there are plenty of criticisms to be made of Backbone, to be sure, the 619 unminified lines that made up version 0.1.0 once again transformed the way that we thought about JavaScript application development. It gave us easy-to-understand building blocks without trying to provide answers to every problem under the sun—perhaps Dojo’s major failing.

Backbone’s tiny file size ensured there would be few accusations of bloat; its utter simplicity and the way it embraced jQuery paradigms made it an easy leap for moderately skilled jQuery developers. Its unopinionated approach meant it was as easy to sprinkle some Backbone onto an existing app as it was to start a new Backbone app from scratch (and equally easy to get yourself into trouble if your own opinions turned out to be bad). Its inclusion of a router,1 a mainstay of server-side frameworks like Rails and Django—well, let’s just say it took Paul’s “Markup-based Unobtrusive Comprehensive DOM-ready Execution” to a whole new level. It also, interestingly, provided a gateway for traditionally server-side developers who had long been turned off by the tangled mess of “get some elements and do something with them.”

Perhaps the happiest thing of all for me, though, was that Backbone made it normal and easy to new up an instance of a View, largely throwing the misguided jQuery plug-in paradigm out the window. Sure, you had to bring your own templating (and rendering) solution to the Backbone.View party, but Underscore was there to help by default; composition wasn’t as straightforward as in Dojo, but it wasn’t hard either.

Adding things like attach points and lifecycle methods and memory-safe teardown was straightforward enough, too. For those ready to make the leap, Backbone became something of a framework-building library. Indeed, on my current project, Backbone serves as the scaffolding upon which we’ve built a much more elaborate client-side application development framework, without having to labor over the basics.2



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.