Skip to content

Commit bc52772

Browse files
committed
clarify wording
1 parent d433636 commit bc52772

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapters/ch09.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ Async Functions...
10051005

10061006
=== 9.8 Complexity Creep, Abstractions and Conventions
10071007

1008-
Picking the right abstractions is hard: we want to reduce complexity in our code flows by introducing complexity that's hidden away behind the constructs we use. Async functions are implemented using generators. Generators are implemented using iterators and promises. Iterators are implemented using symbols. Promises are implemented using callbacks.
1008+
Picking the right abstractions is hard: we want to reduce complexity in our code flows by introducing complexity that's hidden away behind the constructs we use. Async functions borrow their foundation from generators. Generator objects are iterable. Async iterators use promises. Iterators are implemented using symbols. Promises use callbacks.
10091009

10101010
Consistency is an important theme when it comes to maintainable code. An application might mostly use callbacks, or mostly use Promises. Individually, both callbacks and promises can be used to reduce complexity in code flows. When mixing them together, however, we need to make sure we don't introduce context switching where developers reading different pieces of a codebase need to enter different mindsets to understand them.
10111011

0 commit comments

Comments
 (0)