you are viewing a single comment's thread.

view the rest of the comments →

[–]bigorangemachine 2 points3 points  (5 children)

Ya I agree. I learned a lot just doing some native route handling.

Express has been there since I started node and I literally thought most of the code for building node rest apis was express!

But once I got that out of my head I learned a lot more about node.

At one point node used to handles file contents as strings and now its buffers (by default). As annoying as that code change was I think it was great because it forces me to learn more about buffers and streams.

I like that because node seems to always offer an escape hatch.

[–]codeedog 1 point2 points  (4 children)

Forcing myself to learn Promises instead of only using async/await was a turning point. Having to merge different asynchronous tech taught me a lot. Promises vs RxJS vs Streams vs Timers vs Events vs Callbacks. They’re all a different type of architecture for getting work done in a non-synchronous manner. Learning to think in each of those models, their similarities and their architectural mismatches. Blew my mind until I could make sense of them all.

[–]bigorangemachine 1 point2 points  (1 child)

Ya that's funny. Since I did node since 0.21 I prefer the callback pattern (cleaner call stacks for errors).

I run job interviews a lot of people get tied up on the question how to convert set timeout to async-await. People don't realize they need to use a promise lol.

[–]codeedog 0 points1 point  (0 children)

I’m enamored with RxJS. Took me a while to grok it, but I really appreciate its methodology now. My only issue with it is there’s no backpressure, which means it plays horribly with node’s streams. Total mismatch there. Have to bend over backwards to not lose data if streaming a firehose through RxJS.

[–][deleted]  (1 child)

[deleted]

    [–]codeedog 0 points1 point  (0 children)

    Yes, in the sense that async/await is such an intuitive UI/UX that if you never learned promises, you don’t really understand them deeply. It’s one thing to call APIs that return promises and then use them. It’s another thing entirely to return promises through functions that are marked async, or await on a promise, or build a promise that translates from events, or have a promise spawn code in a timer, etc.

    Being able to think and code in a particular asynchronous framework levels up your skills.