Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)
Step Two: Fork this gist.
Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).
- Did any of the responsibilities that she lists surprise you?
- Presentation/interaction, data/server communication, application state, setup. The only one that surprised me a bit was the application state responsibility. I hadn't ever really put it in those terms before.
- Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?
- I didn't consciously split them up like this, but I did make some decisions that supported separating code in this manner...especially when it came to server communication and presentation/interaction. Thinking of it in this way in the future should be helpful.
Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.