3 ms·
I see Doug Crockford's book as a dark magic tome for the dark ages of JS, but that time has passed. Even the codebase of Crockford's old ESLint has moved on to
by threatofrain 5y ago
I see Doug Crockford's book as a dark magic tome for the dark ages of JS, but that time has passed. Even the codebase of Crockford's old ESLint has moved on to modern JS.
That book was published right around the release of Node.JS, the iPhone 3GS, and very shortly after came NPM. So the JS community did not have proper modules back then and would use immediately invoked anonymous functions to mutate the global scope to create a sense of namespace modularization.
The retrospective consequence is that valid JS namespaces like _ and $ are no-go zones for the community, and possibly forever so. Modifying the prototype of common objects also did not help (flat vs flatten). Not a harmonious way of relating to the neighborhood IMO.
And on the matter of async, what we used to have was a hack given by the popularization of a Microsoft browser API.