Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Consider a [queue]:
pullHead: function () {
var value;

if tail >= head {
if (tail >= head) {
value = array[head];
array[head] = void 0;
head += 1;
Expand Down Expand Up @@ -171,4 +171,4 @@ Now we can extend a queue into a deque:

Presto, we have reuse through extension, at the cost of encapsulation.

T> Encapsulation and Extension exist in a natural state of tension. A program with elaborate encapsulation resists breakage but can also be difficult to refactor in other ways. Be mindful of when it's best to Compose and when it's best to Extend.
T> Encapsulation and Extension exist in a natural state of tension. A program with elaborate encapsulation resists breakage but can also be difficult to refactor in other ways. Be mindful of when it's best to Compose and when it's best to Extend.