

Introduction to Node.js with Ryan Dahl - ahmicro
http://ontwik.com/javascript/introduction-to-node-js-with-ryan-dahl/

======
jordanmessina
Is it just me or does it seem like Node.js is taking off like wildfire?

I can't seem to wrap my head around it because there are alternatives that
have been around longer and are more mature. Is it the excitement of building
on top of Google's v8 engine, or the incredible ease of use (I've seen about
15 show HN: Node.js chat server in ____ lines of code), or what?

I'm not bashing node at all, I actually just started getting into it myself
and I'm _really_ enjoying it. But within the past 6 months I feel like I can't
go a day without hearing about it somewhere.

~~~
asolove
I think there is an interesting discrepancy between Node's sweet spot and the
people who use it shallowly. If you read Ryan's short history of where it came
from, Node came from writing systems code in C where he had to deal with
network or async events and finding that he was writing the same code
repetitively.

So you can think of Node.js as essentially the interpreter pattern for systems
programming: use a higher-level language to specify what you want done, where
the real heavy lifting is going on in a faster, lower level language.

Now the people who get excited about Node on HN seem to see it as a faster,
future replacement for Rails (a web development framework), which it might
become, but really isn't. It just doesn't have the abstractions you would want
to build a well-connected stack with router, controllers, ORM, etc. You end up
typing all the glue yourself, and so much of it ends up being confusing if you
write it all async.

A more appropriate use of node is to break down monolithic Rails-style apps
into very small, distributed services, where the data model itself is possibly
not even written in Node, but where Node is doing routing to them.

So think of Node as a tool for writing network system programs in proper Unix
style as small, orthoganal, cooperative tools.

~~~
jordanmessina
I think you're right. Many people are treating Node.js like Tornado
(<http://www.tornadoweb.org/>) and that's not really its intended purpose.
It's hard to make requests in a webapp completely async anyway. As soon as you
get database transactions involved you're screwed. I fear that too many people
hear "it scales" and just jump on board without really understanding the
context in which someone makes the claim.

~~~
sausagefeet
> As soon as you get database transactions involved you're screwed

This isn't true. If your DB has an async API, just wrap that up, otherwise
you're limited to pushing queries to a query-thread-pool to keep the rest of
your app async or implement your DB's protocol in whatever framework you're
using. Twisted has native DB drivers + the ability to push to a thread pool if
you're dealing with a legacy API.

~~~
jordanmessina
I had second thoughts about saying that as soon as I hit reply. You're
completely right. I should have said things get harder, and if you don't
understand what you're doing to start then you're screwed and you don't even
know it.

~~~
sausagefeet
This is why you should just use Erlang :)

~~~
wladimir
If not for the ackward syntax, I'd be using it :)

At least to me, Erlang sounds awesome feature-wise, and have glanced over it
many times, but every time I see an actual program I decide to just go with
Python anyway.

~~~
aaronblohowiak
Maybe you should check out <http://reia-lang.org/> which is rubyish/pythonic
syntax on the erlang vm

~~~
wladimir
Looks very slick. Thanks!

------
kmccarth
Dahl is the man. He is super direct, honest and funny in this interview I did
with him a few months back: [http://bostinnovation.com/2011/01/31/node-js-
interview-4-que...](http://bostinnovation.com/2011/01/31/node-js-
interview-4-questions-with-creator-ryan-dahl/)

------
th0ma5
To me the Node.JS articles are becoming like Erlang as been, something that
gets submitted to the site over and over again. Let me know when there's an
extensive of a library like Java or Python :D I do like the concept of
JavaScript everywhere. For instance, the porting of Toxiclibs to Processing.js
is simply astounding.

~~~
dualogy
This extensive library exists... as millions of separate JS pieces and
snippets scattered around the web, and hundreds of (often fairly buggy) node-
xyz modules on GitHub. Sure, it may be slightly less convenient than a
standardized, readily packaged out-of-box library and it doesn't have 10 years
of testing and refining under its belt yet. But it's there. Some like it raw
and rough!

~~~
DTrejo
Complete searchable list of modules: <http://search.npmjs.org/>

Partial list: <https://github.com/joyent/node/wiki/modules>

All easily installable via

    
    
        npm install express
    

and in yourscript.js:

    
    
        require('express')
    

Edit: Isaac Schlueter is currently working on getting tests of the modules to
show up in search.npmjs.org (to see which modules are good).

------
joshbaptiste
Node.js is especially interesting because it can be suited to a person like me
(with a system administration background) to learn and use Javascript. Most
system admins I know don't usually have a need or care to learn JS under the
DOM, now that we can create network system utilities using JS with ease it is
an attractive alternative to Python/Twisted for some of my projects.

------
discordance
wow, JS and children's literature. Truly a master.

