Think of the bindings as data, not as procedural code.
It's so much more convenient to do it this way (avoiding having to figure out where each bit of behaviour comes from), especially when you're generating UI from within templates.
I'm only 4 hours into knockout.js but this seems to be the key benefit.
I've been massacring functions that manipulate multiple elements and instead am directly tying the behaviors to the underlying data. My future self is very pleased with me.
Comments
Think of the bindings as data, not as procedural code.
It's so much more convenient to do it this way (avoiding having to figure out where each bit of behaviour comes from), especially when you're generating UI from within templates.
I'm only 4 hours into knockout.js but this seems to be the key benefit.
I've been massacring functions that manipulate multiple elements and instead am directly tying the behaviors to the underlying data. My future self is very pleased with me.