Take the 2-minute tour ×

Recently I got introduced to node.js and cool packages like express and jade. I have few questions consistently knocking my door:

If I pick node.js to build my next website, I will be using JavaScript to write my server-side complicated logic? but I don't think you can compare JavaScript with Java or Python to write server-side code as they have such a vast ocean of libraries. Is node.js really meant for it? or I have missed something?

Can I call Java or Python from node.js?

share|improve this question
+1, +fav: I have already made the same question to myself! with no answer! really interested in this answer =) –  Arthur Neves Aug 11 '11 at 22:51
stackoverflow.com/questions/4488614/… check discussion on nodejs vs java –  doNotCheckMyBlog Aug 11 '11 at 22:59
I personally beleive for learning purpose its good to know nodejs but let it get richer to use it in a professional place. –  doNotCheckMyBlog Aug 11 '11 at 23:02
Can you clarify the question a little bit in the following aspect: Are you asking whether one can produce complex but well-organized & maintainable business logic code with Javascript OR one has enough power (libraries) to write complex server-side code with Javascript (nodejs)? In other words, are you targeting maintainability or the availability of the libraries? –  Guven Aug 11 '11 at 23:05
@Guven: It's about availability of the libraries in JavaScript in comparison to Java or Python. –  Vishal Aug 11 '11 at 23:13
show 1 more comment

6 Answers

up vote 16 down vote accepted

Not quite sure what most of these folks are talking about.

A "vast ocean of libraries" is something the community is actively working on. Check this: http://search.npmjs.org/#/_analytics -- there were 8 packages published yesterday

Its not going to solve your software design for you. As for where and how to write business logic, many of us embrace mvc or mvvm or something close to it. If you're building an application and like how Rubyists (for example), structure their code you might look at doing something just like that -- aint nobody going to tell you how to structure your code.

Check https://github.com/joyent/node/wiki/modules

Some of the more popular libraries for doing the day to day:

There's also a host of ORMs out there, if thats your bag. Things like http://mongoosejs.com/, http://sequelizejs.com/ and friends

Test-driven development is at the core of node. There are 15 different TDD packages to choose from that range from full code coverage analysis to custom assert modules.

Saying all modules are incomplete is silly. There is an incredibly dedicated group of people building and maintaining tons working open-source in this community every day.

There might be reasons to pass over node, but its not for an inactive community or lack of libraries.

share|improve this answer
+1, Great answer –  Brandon Tilley Aug 13 '11 at 18:44
add comment

Ryan did not start with JavaScript. A large part of why Node was created in JavaScript is that JavaScript lacked vast oceans of libraries.

Those vast oceans of libraries are almost all written in blocking code.

To take full advantage of Node.js you need to limit your self to non blocking libraries. Which means that might need to write some libraries to complete your project in Node.js.

share|improve this answer
+1 : because a lot of ppl think that as Node.js is javascript we have million of libraries out there, however most of them are blocking code! which doesnt make sense have in Node.js –  Arthur Neves Aug 12 '11 at 13:17
add comment

I would say you missed something - more specifically, the core purpose of Node.js, that is, the asynchronous I/O model.

I started a little pet project to test Node.js - how it "feels" and how to program on it. I became impressed by the ease of working in such ecosystem: Node.js code is easy to write (although its asynchronous paradigm is not that straightforward for the conventional programmer), libraries are easy to build etc. etc. Even npm is amazingly easy: I just found the most straightforward way to provide code of your own as a library is to make a public package of it - and it is absurdly easy!

However, there is not much good tools to work with Node.js. Maybe because it is too easy to do anything, most libraries are partially-implemented, undocumented solutions.

Also, note that the relevant difference of Node.js is not the JavaScript language, but the asynchronous I/O model. It is the most interesting aspect of Node.js, but the asynchronous programming style is not as well tested as the conventional way of web development. Maybe it is really the marvel that is propagandized - or perhaps, it is not as good as promised.

Even in the case it pays off, will you have enough developers to maintain such an (at least still) unusual codebase? If you can get a lot of advantages from the asynchronous "way of life" of Node.js, you can use more consolidated languages and frameworks, such as Twisted for Python (which is my preferred languabe, so take care with my opinion :) ). There may be something like this for Java, too. Anyway, I suspect that you do not have a lot of interest in this model for now, since your question focuses more on languages than in the programming paradigm, so Node.js does not have much to offer to you anyway.

So... no, I would not develop something professonaly in Node.js for now, although I think it is both fun and instructive to study. You can do it, however - just do not do it without having in mind the main purpose of Node.js: asynchronous-IO, event-driven programming. If it is what you want, Node.js is a good alternative.

share|improve this answer
add comment

I think you'll be surprised by the amount of work you can get done in JavaScript via Node.js. There are a bunch of libraries available for Node and more are being written all the time. Furthermore, native extensions are also available for those times where you might need to drop down to a lower-level.

If you think there's a gap where Node won't be able to provide for your business logic, take a look around NPM or give Google a quick serch to see if anyone else has already solved your problem.

share|improve this answer
Do you have some real experience?! some website?! or some solution that you can point me out that is using pure Node.js?! –  Arthur Neves Aug 12 '11 at 13:16
Most of my own personal Node projects are smaller, but it's not difficult to find larger Node apps in the wild. WordSquared is a famous one, and there have been some write-ups on the app. The backend for Voxer is written in Node. You're sure to find lists, posts, and directories if you take a look around. –  Brandon Tilley Aug 13 '11 at 2:17
That's not to say Node is the right tool for every job, nor am I saying that you should build your app solely on Node. That said, asserting that Node isn't useful because it doesn't have a "vast ocean of libraries" is a bit of a fallacy. –  Brandon Tilley Aug 13 '11 at 2:17
Oh, one more! I don't know how I forgot it, but we're using Node.js where I work to drive the "live" portions of our site (environments that function as multiplayer games). –  Brandon Tilley Aug 13 '11 at 5:42
add comment

Of course you can use python, php, c++ or other technologies with nodejs 'cuz node can run it as a child process. Nodejs give your a freedom to use any technology which you want inside itself. You can use whatever you want combining the most performance programms.

share|improve this answer
add comment

There are some things that JavaScript just can't do. If you come up against those Node might not be the best choice for your app. However you can probably accomplish most of what you need.

As far as the API being limited, I suggest you take a look at npm and all the libraries in its repository. Specifically ones like underscore.js. Many aim to fill in the gaps of what native JavaScript lacks compared to other languages.

share|improve this answer
add comment

Your Answer


