Questions (Continued)
What's the best way to debug JSBin?
We can drop in
log
.
function log (x) { console.log(x); return x; }
Then you can drop log
in your compositions.
_.compose(get('title'), log, _.head)(articles)
Now you can save this to a variable
var firstTitle = _.compose(get('title'), log, _.head)
then do things like:
_.compose(_.head, firstTitle)(articles) // returns E
So you're creating a vocabulary of actions and data that you can use to write your program. It's like programming with DSL without knowing it.He mentions what they said at Pivotal Labs: test driven development amplifies the pain if you're software is not well designed.
TDD as software design technique