This guide really shows what I think is a big problem with a lot of Node guides, they don't go beyond the first 5 minutes.
There are a ton of guides on how to set up a webserver in 20 lines, but hardly any on how to (properly) handle a lot of async callbacks and requests etc.
It's hard to cover many aspects of it when we talked about getting our feet wet. I try to include as few terms as possible that potentially confused people to start coding Nodejs-MongoDB. It's probably a big problem when you try to get your feet wet on the first day you learn about swimming just by jumping all over the pool. But then, hopefully, we learn.
Going into how to handle a lot of async callbacks/requests would be entirely different subject matter, would it not? The blog post is titled "Nodejs and MongoDB, A Beginner’s Approach" and that's the subject matter it tackles.
Agree with this. Was disappointed the guide didn't delve into asynchronous even at a basic level. This is what makes nodejs and mongodb worth using and I don't think the concepts are overly difficult to grasp.
To be honest, a good attempt by the author but I wouldn't recommend this to a beginner. Why? I don't recommend the use of the native driver - you end up with needlessly complex code.
I don't want to criticize the authors work. He's done a pretty good and thorough job. Hopefully I'll pen down an easier guide later tonight.
Yeah, I'd say many folks will probably end up wanting to use something like Mongoose to abstract the nitty-gritty details of Node/MongoDB interaction, but knowing how to use the underlying library (and node-mongodb-native is the most popular of them by far) is healthy for beginners.
Actually it's more like: hey, let's take two tools that ought to be used with utmost caution by people who know what they're doing and why they need them, and present them as the best thing since sliced bread.
The huge majority of uses for either would be better served without them.
Mongo is excellent but I'd argue that Node and CouchDB is even a better fit because there's not even a driver involved, it's one HTTP request which just calls another.
On a related note, I'm working on a synchronous narwhal-mongodb compatible driver that would work with common-node (http://olegp.github.com/common-node/), Would anyone be interested in helping out?
I'm both Node and MongoDB user and like them, but this can get really messy when there's a chain of callbacks involved, eg when you need a sequence of results but want to do it in a asynchronous fashion.
While I wouldn't quite call it pretty, it keeps things at the same indentation level, and I can still use closures to maintain the illusion of a single "thread".
[+] [-] qF|14 years ago|reply
There are a ton of guides on how to set up a webserver in 20 lines, but hardly any on how to (properly) handle a lot of async callbacks and requests etc.
[+] [-] dpapathanasiou|14 years ago|reply
[+] [-] ksetyadi|14 years ago|reply
Thanks for your opinion :)
[+] [-] mcantelon|14 years ago|reply
[+] [-] Finbarr|14 years ago|reply
[+] [-] Srirangan|14 years ago|reply
I don't want to criticize the authors work. He's done a pretty good and thorough job. Hopefully I'll pen down an easier guide later tonight.
[+] [-] mcantelon|14 years ago|reply
[+] [-] ksetyadi|14 years ago|reply
[+] [-] stottc|14 years ago|reply
[+] [-] frou_dh|14 years ago|reply
[+] [-] dextorious|14 years ago|reply
The huge majority of uses for either would be better served without them.
[+] [-] wavephorm|14 years ago|reply
[+] [-] olegp|14 years ago|reply
[+] [-] senko|14 years ago|reply
[+] [-] beyondkaoru|14 years ago|reply
https://github.com/creationix/step
While I wouldn't quite call it pretty, it keeps things at the same indentation level, and I can still use closures to maintain the illusion of a single "thread".
[+] [-] latch|14 years ago|reply
[+] [-] tista|14 years ago|reply
[+] [-] latch|14 years ago|reply
Mirror: https://gist.github.com/1327266