Linked List
var first = { value: 12 };
var second = { value: 99 };
var third = { value: 37 };
first.next = second;
second.next = third;
Slide 8
Slide 8 text
Linked List
var list = new LinkedList();
list.append(12);
list.append(99);
list.append(37);
list.each(function(v) {
console.log(v);
});
// log:
12
99
37
Slide 9
Slide 9 text
Object Behavior
• Return a value
• Send a message to another object
• Change internal state
When receiving a message:
Slide 10
Slide 10 text
Testing Object Behavior
When receiving a message:
• Return a value
• Send a message to another object
• Change internal state
Slide 11
Slide 11 text
Linked List
var list = new LinkedList();
list.append(12);
list.append(99);
list.append(37);
list.each(function(v) {
console.log(v);
});
// log:
12
99
37
Slide 12
Slide 12 text
TDD
• No production code which does not
make a failing test pass
• Stop writing test code once there is
enough to fail
• No more production code than will
make the test pass
Slide 13
Slide 13 text
Transformations
Refactor
change form without changing
behavior
Transform
change behavior while changing form
as little as possible
Slide 14
Slide 14 text
Transformations
• None
• One
• Many
Slide 15
Slide 15 text
Transformations
Tranformation
Priority Premise
Transformations emerge
in a logical sequence
as the code evolves
Slide 16
Slide 16 text
Transformations
Tranformation
Priority Premise
Transformations emerge
in a logical sequence
as the code evolves
specific → generic