Nerd Post: Why I’m moving to closure for some of my projects
I’ve been working on an HTML5 app for the chrome store for a few weeks now, it started to slow down recently because I was getting worried about something. You see, I had been using jQuery as my library of choice. and I still love me some jQ. This is not a bash jQuery post, but more to speak towards the limitations I feel it is beginning to impose on me.
This app is built almost entirely JS and allows users to upload, manipulate and group images. When I first thought about it, I planned it out as a series of jQuery plugins which while sound in jQuery development becomes a nightmare of passing functions and variables around, possible duplicated code, and a spaghetti of a mess. I stopped, took a breath and looked around. After looking for a bit I found Closure and Backbone.
So, why closure? Well, I like the compiler and I’m an unabashed Google Fanboy. Could I probably organize my jQuery better and deal with the pain of passing data around (which granted the .data() makes a lot easier), or do I use this as an excuse to expand my skills. Since my timeline is essentially non-existant I decided to step back choose a new path and move forward. The things I like so far about Closure:
- Built in templating (that looks a lot like mustache) but is its own beast
- The compiler, that magical compiler.
- Built in goog library of ui/event driven libs
- Namespacing - hence the organizing
I’ll keep this blog updated with how it goes, but so far, with only one minor hiccup, I’m having a blast. Onward to JS heaven!
4 Notes/ Hide
-
8bitorange posted this