Skip to content

Commit f3a355a

Browse files
mindaugasmaceviciusbevacqua
authored andcommitted
fixed typos and inacurracies (#17)
* added space between words * correct function name * fix typo * Reverted
1 parent 2e6c143 commit f3a355a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapters/ch04.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ When we'd have to repeat ourselves by passing a lot of scope variables as functi
4848

4949
==== 4.1.3 Frameworks: the Good the Bad and the Ugly
5050

51-
Conventions are useful because they allow for better self-direction amongst developers, without causing lagoons of inconsistency to spread across our codebase as fate would have it were we to allow a team of developers too much freedom without sound design direction and conventions that dictatehow different portions of an application should be shaped. A large number of conventions might hinder productivity, especially if some of our conventions appeared to work as if by magic.
51+
Conventions are useful because they allow for better self-direction amongst developers, without causing lagoons of inconsistency to spread across our codebase as fate would have it were we to allow a team of developers too much freedom without sound design direction and conventions that dictate how different portions of an application should be shaped. A large number of conventions might hinder productivity, especially if some of our conventions appeared to work as if by magic.
5252

5353
When it comes to conventions, frameworks are a special case. Frameworks are packed to the brim with conventions and best practices. Some of them live in the library and tooling ecosystem around the framework, while many live in the shape our code takes when we rely on said framework. Upon adopting a framework, we're buying into its conventions and practices. Most modern JavaScript frameworks offer ways of breaking our application into small chunks, regardless of whether the framework is for the client or server.
5454

@@ -320,7 +320,7 @@ a(function () {
320320
})
321321
----
322322

323-
The foremost problem with this kind of structure is scope inheritance. In the deepest callback, passed to the `g` function, we've inherited the combined scopes of all the parent callbacks. As functions become larger, and more variables are bound into each of these scopes, it becomes ever more challenging to understand one of the callbacks in isolation from its parents.
323+
The foremost problem with this kind of structure is scope inheritance. In the deepest callback, passed to the `d` function, we've inherited the combined scopes of all the parent callbacks. As functions become larger, and more variables are bound into each of these scopes, it becomes ever more challenging to understand one of the callbacks in isolation from its parents.
324324

325325
This kind of coupling can be reverted by naming the callbacks and placing them all in the same nesting level. Named functions may be reused in other parts of our component, or exported to be used elsewhere. In the following example we've eliminated up to 3 levels of unnecessary nesting, and by eliminating nesting we've made the scope for each function more explicit.
326326

0 commit comments

Comments
 (0)