What if you could write the app that’s in your head
What if you were able to take the vision in your head and turn it into a working and running program. Imagine knowing exactly which statement to write next. You’d be the one in control of your app. You’d write programs that
- finish database calls and only then continue further processing
- have variables filled with values when you need them
- have HTTP calls that run one at a time
- You’d be able to express program logic in Node.js.
- Every statement in your program would have a reason to exist.
- Time spent working on your app would go to implementing new features.
It’s true asynchronous calls are a little hard to grasp, but it’s possible to make your text editor the place where working programs are written.
You’d know exactly which line to write next
The key to writing working programs is to understand how Node executes your calls. The internals of Node are predictable when you zoom out from the level of individual statements and for-loops. When you look at the system that takes over when you return from a top-level function you’ll start to understand how Node works.
Time spent on your app would go to implementing new features
When you understand what takes place behind the scenes, you're able to get the right mental model how to write Node programs. You'll be able to write programs that work as intended.
And that is exactly what you’ll learn in this book.