Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Off the top of my head benefits:

  -No mental context switch when working on both ends
  -Easier serialization (though JSON is pretty portable...)
  -Sharing code
They aren't exclusive to Node and JS, but browsers run JS and will continue to for the foreseeable future. Since the front end can't budge its language at the moment, the back end has to.


I see the "sharing code" claim a lot but I haven't really seen it substantiated. Seems like you write a few little functions but it's not like you sharing the same framework which would be the real benefit.


> Seems like you write a few little functions...

Seriously? A very common problem in web apps is validation logic is usually duplicated in JS and Server side language.

Node allows the same logic to be used in both cases. These are not a 'few little functions'. Validation is a central part of most business applications.

Given the potential to template html with javascript, and to code exclusively in javascript. You could end up with webapps written entirely in one language.

Whether that is a good thing or not remains to be seen, but it is something that we should pay attention to.


In my experience, most validation on the server is a superset of what's required on the client (or disjoint).

For example, validating a user's name on the client merely checks if the name's length is in a certain range and doesn't contain invalid characters. On the server it requires a query to the database -- possibly more.

I also reject the notion that there is a significant context switch involved in going from one language to the other.


Validation is not a central part of most biz applications. Validation on the client side is a UX convenience, but not strictly necessary because anyone with two brian cells to rub together is going to ignore any client side validation and run the real input validation on the server.




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

Search: