John Elliott

Refactor day

I did a much-needed refactor over the last few days of the Backbone app inside the Waybot Rails app.

Previously, most of the javascript for the live-updating chart was bouncing around in the javascript global namespace. I wanted to stop polluting the namespace with my app’s parts and stop the different parts of the app from sharing one another’s responsibilities.

I placed all the backbone app concerns into a namespace and placed come of the internal concerns where they should be (e.g. the collection of data points listens to incoming sockets messages, the view listens for new data being added to the collection of data points).

I feel a lot more comfortable now that my code is tidier and the model, collection, and view responsibilities are more pure.

Check it out: Waybot on github.