5 ms·
The Node Beginner Book
- nailer 16y agoGood things: - Tells me what I'll make with the tutorial right up front. - Lets me know exactly what prerequisite knowledge is (I can tick all those boxes, good). - Aimed at folks who know traditional backend languages and some JS but aren't JS Gods (a lot of node tutes seem to assume complete JS mastery). No bad things so far! Thanks Mr Dumas.
- WA 16y agoBad 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 information around. It is simply not possible to learn NodeJS from tutorials at the moment, because almost all tutorials deal with a) getting a webserver up and running in 20 lines of code or less or b) uploading a file. Seriously, either I want to deal with Node.JS to build network apps (then why all the tutorials about building web apps) or I want to use a framework to get my web app up and running in no time. But I really have no interest in writing a webserver and dealing with the routing on my own. There is Express, but tutorials are outdated or don't cover it in depth. Furthermore, Node.JS is very cumbersome to install, as you need to compile it, compile a packet manager and a thousand other things before it is ready to go (if you want to use it for web development). As long as people keep repeating the same tutorials over and over again, I don't see Node.JS becoming a popular tool for building web apps in the near future (which is sad, because I do kind of like Node). What I would like to see, is either a tutorial that focuses on building a framework from scratch or one that focuses on the use of an existing framework.
- olegp 16y agoThe DailyJS tutorials are a great starting point for this: http://dailyjs.com/2010/11/01/node-tutorial/ http://dailyjs.com/2010/11/01/node-tutorial/ That being said, I agree with most of the issues you raise. Lack of backwards compatibility, rapid changes in APIs and the need to build from source make building webapps in Node more complicated than it needs to be. We're trying to address this at Akshell (http://www.akshell.com http://www.akshell.com) by making it as easy as possible to get started, providing consistent documentation & core libraries and favoring synchronous I/O. It would be great if you had time to check it out and give us some feedback: http://www.akshell.com/docs/0.3/intro/ http://www.akshell.com/docs/0.3/intro/
- ascendant 16y ago> That being said, I agree with most of the issues you raise. Lack of backwards compatibility, rapid changes in APIs and need to build from source make building webapps in Node more complicated than it needs to be. I think Node is on the precipice of being ready for primetime. There is quite obviously a groundswell of interest. I myself was screwing around with it last night trying to get Express, node and Mongoose to work and I couldn't figure it out with the docs I found (99% sure problem is on my end though). Since there is rapidly growing demand for documentation and examples, the community will work to fill that. I would be surprised if we make it another 6 months without someone really picking up the reins and taking the lead for community documentation. Who knows, maybe someone already has and I just haven't picked up on it yet?
- WA 16y agoThanks, I'll check it out tomorrow and give you some feedback.
- mcastner 16y agoI definitely noticed this weird lack of information on Express. I've found the best thing is to check out the examples from Express' own github: https://github.com/visionmedia/express/tree/master/examples https://github.com/visionmedia/express/tree/master/examples That's useful to see how something is done, but not why or the different options available. For that, there's still a definite lack of a clear guide. The guide on the Express website reads more like an API reference and doesn't go into detail on how to use the different features, which I think would be very helpful. Right now I'm working on my first application using Express. Over the Summer, when I have free time, I'd like to write a tutorial series for Express and put it up on github so it can be updated as Express evolves. That's really one of the main issues right now, all this stuff is changing so rapidly that a tutorial can become outdated in a few months.
- nathanwdavis 16y agoYou 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.
- charper 16y agoStill technically builds from source : brew install node ==> Downloading http://nodejs.org/dist/node-v0.4.6.tar.gz http://nodejs.org/dist/node-v0.4.6.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/Cellar/node/0.4.6 ==> make install
- shawndumas 16y agoWhile I appreciate the thanks, I am only the messenger!
- hutushen222 16y agoThough I learn only a little JavaScript, I will try it while I have a block time. Now, just save it to my personal archive.
- d0m 16y agoI suggest using syntax highlighting in code examples.
- ManuelKiessling 16y agoHi d0m, that's a very valid point, I will work on that soon!
- rbonvall 16y agoYou can use http://code.google.com/p/google-code-prettify/ http://code.google.com/p/google-code-prettify/
- ManuelKiessling 16y agoThanks, I'll give it a try!
- brown9-2 16y agoA little confusing that the title refers to "Node" rather than "node.js".
- Khao 16y agoNode is actually the real name. It is often referred to as node.js just to distinguish it from other concepts and stuff named "Node". If you go on nodejs.org, you'll see that they always refer to it as just "Node" in the About section.
- ManuelKiessling 16y agoHi 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 great example to explain all of the fundamental concepts, new JavaScript ones and conventional ones (because it might makes sense to understand what stuff is done differently and what is done in a known fashion). So nothing really new here - I hope where this tutorial differs is that it (arguably) might be the first "one-stop" tutorial for Node to get beginners started. Not more not less. Every other resource I could find forced me to google around to fill the gaps - while this is not a bad thing per se, I think sometimes it's nice to have something that really guides you from A to Z. Like, for example, http://ruby.railstutorial.org/ http://ruby.railstutorial.org/. If I manage to create something that's only 10% as cool, I'm going to be very happy :-)
- thenduks 16y agoHi there, thanks for this, I've been looking for something self-contained-ish to point friends to when asking about node. One thing, the site is really messed up in browsers that aren't super wide. My browser is ~1100px wide and the size/positioning of the main content puts it off the right side of the window forcing me to scroll horizontally. I'm not sure why you have stuff like `margin-left: 160px;` in there. It would be a lot better to use `margin: 0 auto;` so people with small screens or unmaximized browsers wont be assaulted :) Thanks again! edit: To be clear, I'm suggesting: #book, #disqus_thread, #footer { /* your styles */ margin: 0 auto; margin-top: 24px; }
- ManuelKiessling 16y agoHi thenduks, thanks for this one! I changed the CSS as you suggested and updated the site, it's now scroll-bar free down to 1000px.
- thenduks 16y ago
- city41 16y agoI'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 parts of node multi threaded? The callbacks being called serially makes perfect sense, its the parallelness of the actual operations that confuses me.
- aaronblohowiak 16y agoThere are io threads just like there are for xhr in the browser -- but your app code is single threaded.
- ManuelKiessling 16y agoI too still don't understand 100% what's going on behind the scenes of node/V8 regarding threading/parallelism, but this post here helped me a lot to understand it from a bird's eye perspective: http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb http://debuggable.com/posts/understanding-node-js:4bd98440-4... It's also linked from The Node Beginner Book.
- 2mur 16y agoI think that this SO thread is helpful: http://stackoverflow.com/questions/3629784/how-is-node-js-inherently-faster-when-it-still-relies-on-threads-internally http://stackoverflow.com/questions/3629784/how-is-node-js-in...
- tlrobinson 16y agoYes, 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.
- RyanMcGreal 16y agoThis was a well-written, easy-to-follow introduction, but I'd gladly pay money for an actual Node book that takes the reader from introduction to mastery.
- ManuelKiessling 16y agoHi Ryan, The Node Beginner Book is still work in progress, it's currently about 35% done. So, there is more to come, but bringing people from introduction to mastery is a completely different story of course. We will see how things develop :-)
- RyanMcGreal 16y agoLike I said, I would consider paying for a copy once it's finished. :)
- ManuelKiessling 16y agoI'll get back to you when it's pay day ;-)
- 2mur 16y agoThere are apparently at least 3 books in the works: http://groups.google.com/group/nodejs/browse_thread/thread/acaf32ad1bf1616f/88e601483d45bdc5?hl=en&lnk=gst&q=books#88e601483d45bdc5 http://groups.google.com/group/nodejs/browse_thread/thread/a...
- yardie 16y agoThis will be an invaluable guide in the future but I think it needs more work. Hello World has been covered everywhere so it's utility as an intro is pointless if you are already a programmer or are familiar with programming. The guides I find most useful, in addition to references, are the ones that have you build an application from the ground up. So that you start to understand the pros and cons of the language you are trying to learn. I already know how to do Hello World, I already know how to create a node server, what I want is a bit more context, like building a simple messaging server, how to create and use simple frameworks, whats even more appreciated is tutorials and samples about the stuff already built-in. This is one of the reason why I like working with Apple and Microsoft. They give you tons and tons of sample code that compiles and work. Want access to process information? Here's how. Want to use the camera? Here's how. It would be great to have a simple CRUD node app that connects to MySQL. That usually gets me 75% of the way there.
- ManuelKiessling 16y agoHi yardie, I agree, which is why I only very briefly bring up the Hello World stuff (it's a tradition after all :-)), and then state "Ok, this stuff is boring, right? Let's write some real stuff." And the rest of the tutorial is about building something real and complete (albeit simple). Maybe I should extend the example app a bit, and talk about databases, too. Oh, and please note, the "book" is only about 35% complete, so there is more to come!
- yardie 16y agoI've just started to get into it, it's a fantastic job so far so please keep it up. I think you, the nodejs team, and webos are doing a great job.
- rmason 16y agoI second the need for a good CRUD example. Also "clear" instructions on running NODE on Windows would be a big help.
- dualogy 16y agoEasiest way to get going on Windows is precompiled with Cygwin packaged in: http://node-js.prcn.co.cc http://node-js.prcn.co.cc
- Apocryphon 16y agoI've asked this already (http://news.ycombinator.com/item?id=2447840 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.
- nathanwdavis 16y agoI thought Javascript Patterns by Stoyan Stefanov was pretty good and not too client-side centric.
- telemachos 16y agoI 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 Tom Hughes-Croucher's Up and Running with Node.js[3], which is in progress and available through O'Reilly's open feedback system. At the moment, blog posts and online tutorials seem to be the way to go, though you have to be careful there too. Node seems to be moving very, very fast, so things will likely require a medium amount of tinkering, even if they were written two weeks ago. [1] http://tddjs.com/ http://tddjs.com/ [2] http://oreilly.com/catalog/9780596805531 http://oreilly.com/catalog/9780596805531 [3] http://ofps.oreilly.com/titles/9781449398583/ http://ofps.oreilly.com/titles/9781449398583/
- Apocryphon 16y agoI 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.
- rick_bc 16y agoKind of off-topic, but I don't really understand what Node.js is about until this presentation. http://jsconf.eu/2009/video_nodejs_by_ryan_dahl.html http://jsconf.eu/2009/video_nodejs_by_ryan_dahl.html http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf
- ManuelKiessling 16y agoFor your consideration: I've just added the chapter on how to integrate request handlers into the router: http://nodebeginner.org/#routing-to-real-request-handlers http://nodebeginner.org/#routing-to-real-request-handlers