Hacker News new | past | comments | ask | show | jobs | submit login
From Java to Node.js (n0tw0rthy.wordpress.com)
94 points by matan_a on Jan 9, 2012 | hide | past | favorite | 10 comments



Wow, it's really nice to see an article that isn't a "my language/platform of choice is better than yours" rant. I'm especially surprised to see a Java developer embrace node.js so whole-heartedly.


I've come from a Java background to node.js and have enjoyed it. I'd tried a few Java frameworks for web development (Grails to a large extent and lift/spring to a small extent) but was never really happy with them. I dabbled with RoR but found it too alien. I've got no criticism to level at RoR it just didn't feel right to me, possibly if I'd continued I'd either have a strong opinion about why it's wrong or would have learned to love it. Eventually I picked up node and really enjoyed using it to develop my latest site and will probably continue to use it in future if I can and if it makes sense. I'd recommend it to any dev looking for something to new to try out.


Just curious, are you using any framework in your Node projects?


"""Eventually I picked up node and really enjoyed using it to develop my latest site and will probably continue to use it in future if I can and if it makes sense."""

Node is a special purpose evented system, not for general web site creation, though it can abused to do both.

But I would not compare it with Grails/Life/Spring or Rails/Django/Cake/Symphony etc...


This is great. Nice and concise. No zealotry, just sane practical experience. I'm going through exactly the same thing.. Longtime java dev, surprised and delighted by all the activity around node, seriously considering it for my next project. At least for prototyping it. Never imagined i would embrace end to end javascript! But it seems like a nice balance of productivity and robustness.. And the author is right to emphasize the importance of good frameworks. Too many of these new fangled language HN posts overemphasize language-level details and miss out on the critical role of good frameworks in making you productive. For whatever reason (javascript) the node community is super active in this respect.


He says: "There is no shortage of ORM librares for Node.js."

However, I personally don't find any production ready ORM. Especially when you consider what Django, or Rails or Hibernate can offer.

Having said that, Node and MongoDB really get along well.


While i did see quite a bit of options for node, i haven't been playing around with ORMs in Node too much. ORMs to me refer to those used with relational databases and I haven't done that yet in Node.js. i've just been using MongoDB (mongoose) and Redis (node_redis) - both of which have good libraries.

Also remember that the very nature of JavaScript might make the classic idea of how an ORM is implemented a little different.


He will switch back when the users start complaining about performance.


Here's a rehash of my comment on the blog which might cover this point:

From my experience, performance is a tough question to answer because you really have to think of the system as a whole. The weakest link (slowest piece) usually dictates the overall system perceived performance. Having a slow DB isn't going to make your choice of Java or Node.js matter that much...

So assuming that everything else is equal (like architecture, data structure choices, database driver quality, database design and queries, etc) it might be that Java is faster.. but it might be a moot point.

Writing asynchronous code in Node.js is much more convenient than Java and helps in doing more at the same time so that you aren't waiting for all those database queries to run one after the other, for example. Check out the Node.js async module for some cool patterns to use (https://github.com/caolan/async).

In all, I wouldn't make the choice to move to Node.js because it has better performance or not, but the overall holistic view.


Welcome, comrade.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: