I have yet to learn a programming language, and I have to choose between Python and JaveScript for my project.
With Python, I know, most of the libraries are already there for me, quite ready to use. But I absolutely love the fact that if I learn JavaScript, I can do both server-side (Node.js) and client-side (jQuery) scripting in one language; plus Node.js is considerably faster than Python from what I read. And I am obessed with that.
But that also means, I might have to create my own modules/libraries from scratch for my project, due to the lack of many standard libraries in JS (at least that’s what I heard). So, can someone who’s been into JavaScript/Node.js/jQuery stuff please tell me this – – what’s the timeframe it normally takes to complete writing a custom library in JavaScript?
Timeframe = from “time taken to write a basic library” to “time taken to write a very complex library”. For example, “like 10 days to a month.”
That will really help me decide whether as a beginner I can depend on JavaScript/Node.js combo for my project right from the start. Thanks.
I’ve written a ton of node.js libraries for my work at i.tv. The fact is that if you know Javascript it’s not that hard and there are already a ton of libraries out there. For the stuff I imagine that you want, the answer is that someone else probably already figured out how to do it. If that’s not the case JavaScript is incredibly easy to learn and has a great community. Like other posters said it doesn’t strictly enforce conventions or a best way, but learn from examples, see what other people are doing and ask for help on StackOverflow or IRC!
Some of the libraries that exist include database connectivity (mongoose), web-framework (express), making http requests (request), doing fancy stuff with dates (moment.js).
Two great places to look for node modules are:
For general node instructions and help, there are some great (though occasionally dated) articles on the site http://howtonode.org/. If you want to get into the knitty gritty the node.js mailing list is a great place to learn about the latest and greatest modules. A final suggestion is to following the JSMentor’s mailing list. People there debate JavaScript best practices all day long.
Best of luck to getting started with node.js. It’s a lot of fun.