Orthoducks, In response to the subject line (what's important to learn about NodeJS), I was going to encourage you to play the Stream Adventure game -- but Mikeal beat me to the punch with the link to nodeschool.io, which includes Stream Adventure. The one thing I would encourage learning before streams is basic async programming, which you'll run into as soon as you try to do pretty much anything. A simple console app that does some File I/O, Database I/O and network I/O would be a good start -- and then, after you've written a piece of code with half a dozen nested callbacks, try to find the most helpful method in the "async" flow-control module to help reduce the number of callbacks.
In response to your actual question -- why aren't web servers encapsulated from web applications in node and abstracted away -- I think the answer is because node treats abstractions as a necessary evil (following the unix philosophy). It is like the C standard library in this respect -- there aren't a lot of what you would call "high level abstractions" or high-surface-area things that have a bunch of configuration, like web servers. Instead, each of the pieces necessary to build a web server are provided and you can hook them together in any way you see fit. So instead of configuration (as you would have with apache or nginx), you have code -- and you have something infinitely more customizable. You'll find that the "user land" -- the 3rd party modules created by other devs -- is very much the same way. At first, I was surprised and it didn't seem right -- or at least didn't seem familiar. But once I got comfortable with it, I love it, because I can pick and choose only the functionality I need -- no more, no less -- and put it exactly where I want it. I don't need to work around monolithic abstractions that provide some of what I want, but also have a bunch of other stuff I don't need or want. There are a few "big framework" things in node that provide a lot of functionality -- like the express web framework -- but when you start working with it, you realize that it too is just a collection of small-complexity, small-surface-area modules that you put together yourself. And I would encourage writing your own web server using node's http module first, before jumping to a framework like express, as a good learning experience -- I did it this way and I'm glad I did. You might think: why? Doesn't a web framework abstract everything away? If so, why would I need to learn it? But in node, the web frameworks don't abstract everything away -- they automate some common chores, but they work at the same basic level of abstraction as the core http module, so it's very useful to get to know the core building blocks and how they work by themselves, before learning the frameworks that automate some of the common chores. Then you'll have a better understanding of why things work the way they do. One module that I really like and use a lot is https://github.com/cloudhead/node-static -- a static file server. It's really nice that in node I can just drop in a static file server when and where I need one... Or for another example, you can independently use a Least Recently Used cache -- https://github.com/isaacs/node-lru-cache -- to do the static file caching yourself or -- and this can really come in handy -- to cache other things that you might need to serve that are not files... or to preprocess files before caching & serving them. It's kind of crazy, but all the different pieces that you might need, from big to small, are available and you can play with them and hook them together like legos. Two posts that I really like that help outline the node/unix philosophy are http://blog.izs.me/post/48281998870/unix-philosophy-and-node-js and http://blog.izs.me/post/146672514/going-fast-frankenstein-and-refactoring. The idea of abstractions being a necessary evil and focusing on composition over inheritance and putting together lots of small modules with small API surface areas. This is what I love most about node. The Javascript language itself isn't particularly well-designed (unlike Go) and will probably have seen its heyday and start a decline in a few years, but IMO the Unix small-and-sharp philosophy is what makes the node ecosystem so valuable. -- peter -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
