Hacker News new | past | comments | ask | show | jobs | submit login

So I'm curious as to the reasons people chose Node.js

Javascript of course ;)

You can leverage the same language for server side stuff and browser programming.

But how valuable is that? I hear this a lot but is it really that much of an inconvenience to write backend code in a different language? Especially if there are different engineers working on the frontend and backend.

It's very valuable if you are bouncing back and forth between frontend and backend. There's no context switching as you do that. The cognitive overhead of context switching is higher than people generally accept. This is why stacks like the MEAN/MERN stack get used in hackathons. You've got a JSON-inspired database (Mongo) with a minimal server-side framework (Express) feeding a React/Angular front-end. You can use the same libraries client/server side like Mocha for unit testing, Lodash for collection manipulations, you can even share the same validation files for server & client.

"There's no context switching as you do that"

So, you just read/write to a database wherever? Or do you have to remember the context the code is running in?

There may not be syntax switching, but I think you stil usually need to remember where the code in question will be executing (well... I need to, anyway)

Language is never the problem. Languages (mostly) are easy. Frameworks are hard. Tooling can be hard (pick a language).

Javascript is easy. Express, NPM, Bower, <insert framework of the month> are tough.

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