Live data from Hacker News

The Node Beginner Book

nodebeginner.org

41–49 of 49 posts

Re: The Node Beginner Book

#42

I've asked this already ( http://news.ycombinator.com/item?id=2447840 ) but what books on JS are good for someone who wants to go into development with Node? Most texts that I know of deal with client-side JS. Right now I'm just reading Eloquent Javascript + JavaScript: the Good Parts, but I would like to see if there's any other books that would be good, especially for someone new to closures.

I think newer Javascript books are beginning to add or expand sections on client-side uses and node.js in particular. Two that I know have sections are Test-Driven JavaScript Development [1] and JavaScript: The Definitive Guide, Sixth Ed [2]. The TDD chapter on node is probably already out of date in some respects, the Definitive Guide no doubt will soon be out of date, and both are smaller/smallish. There is also To…

I think what I'd just like is a JS primer that goes through certain features in the language that could be useful for server-side things, including Node. Especially closures.

Re: The Node Beginner Book

#43
post #12

I'm still trying to understand how node actually works. I'm just about to start digging through its source code. It seems most people view node as a magical mystery that they don't understand why it works, just that it does. How is a single threaded app doing things in parallel? Is it like a game loop where it iterates through all its pending operations and gives each a slice of time to progress forward? Are deeper p…

Yes, it's similar to a game loop, but in Node it's called an event loop. All JavaScript code executes in the main thread, with the event loop (libev) coordinating asynchronous IO APIs, the thread pool, and signal handlers. Node continues executing until there are no more pending operations, then exits.

Most IO in Node doesn't require additional threads; it uses libeio for asynchronous IO on POSIX systems (I believe they're currently working on an abstraction for asynchronous IO in POSIX and Windows).

It does need to use the thread pool for IO operations that only have a blocking API (stat() and friends, legacy database libraries, etc). The blocking API call is executed in a separate thread so the main thread is never blocked on IO.

This is a bit of a (necessary) hack, and ideally all IO could be done using non-blocking APIs.

Re: The Node Beginner Book

#46
post #7

Earlier quoted context omitted.

Bad things: Shows the very same tutorials over and over and over again. Last week, I tried to get my hands on NodeJS in a reasonable short time. That means, I wanted to write a basic web app with some AJAX in NodeJS having 1 or 2 days to actual learn it and another 3 days to implement the app. As much as I would love to see NodeJS to become more widespread, it's not gonna happen with these sparse amount of informatio…

You don't HAVE to build from source: brew install node And I think there is a deb package as well. But, I think I remember someone on the core team recommending to just build from source for now. I have not been doing that and it has been fine though.

Still technically builds from source :

brew install node

==> Downloading http://nodejs.org/dist/node-v0.4.6.tar.gz

######################################################################## 100.0%

==> ./configure --prefix=/usr/local/Cellar/node/0.4.6

==> make install

Re: The Node Beginner Book

#47
post #19

Hi all, I'm the author of The Node Beginner Book. Thanks for discussing it here. Your input is a great help. I see the points WA makes regarding the bad things. It's true that it's yet another Node tutorial chewing around on the web server / web app stuff; but I think for the people I'm addressing it's still the most useful scenario because it allows to understand how a full fledged app is put together, and is a grea…

More node resources the better at the moment. A simple CRUD application guide would be very helpful. The java Play! Framework site has a really nice basic blog tutorial which is perfect for understanding the entire process. I plan on starting my first node app in 6 weeks so please hurry up ;)

Here's a list of CRUD+ apps that I keep open in textmate to consult as examples:

I suck at formatting here; apologies in advance.

Alex Young's NodePad (from daily.js) (more than a simple CRUD app but helpful nonetheless)

  https://github.com/alexyoung/nodepad 
Individual Node + Express examples by TJ (as mentioned in another post)

  https://github.com/visionmedia/express/tree/master/examples
Another basic Node+Express example (by TJ again)

  https://github.com/visionmedia/finance
Guillermo posted a CRUD with Express + Mongoose a few days ago

  https://github.com/guille/mongoose-meetup-04-05/
There's another VERY simple CRUD app somewhere in the Mongoose Google group as a zipfile(yes, this uses Mongoose as well obviously). I can't seem to find it right now, but I think Siegfried Ehret was the original poster. Email me if you'd like me to send it to you.

Also try nodetuts.com. Pedro's stuff helped me when I started learning a few months ago. Some of his stuff might be out-of-date but it will still help you conceptually (and not all of it is by any means). Some out-of-dateness will just be making simple code changes (like upgrading Express).

Hope this helps!

Re: The Node Beginner Book

#48

Earlier quoted context omitted.

Sweet, looks awesome. Btw, on a positive stylistic note. I love the big container and big text. Too many sites these days have tiny microscopic text -- I couldn't read that stuff if my life depended on it, and my eyes are 20/20! :)

Yeah, I hate that too. The only thing even more evil are sites that present you a tiny font on mobile devices AND don't allow you to zoom. But saying this, I have to admit while http://nodebeginner.org can be zoomed on the iPhone, the font could still be a bit bigger for my taste (but on the normal site it's ok how it is). Any idea how to tell CSS that I want an even bigger font on Mobile Safari?

Indeed I do!

Try something like this to get started:

    -webkit-text-size-adjust: 160%;

Re: The Node Beginner Book

#49

Earlier quoted context omitted.

Yeah, I hate that too. The only thing even more evil are sites that present you a tiny font on mobile devices AND don't allow you to zoom. But saying this, I have to admit while http://nodebeginner.org can be zoomed on the iPhone, the font could still be a bit bigger for my taste (but on the normal site it's ok how it is). Any idea how to tell CSS that I want an even bigger font on Mobile Safari?

Indeed I do! Try something like this to get started: -webkit-text-size-adjust: 160%;

Great, I'll give it a try! Thanks so much!
Post reply on HN