3 ms·
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
by Scarbutt 10y ago
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.
- lasfter 10y agoBut 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.
- jdhawk 10y agoLanguage 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.
- chrisco255 10y agoIt'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.
- mgkimsal 10y ago"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)