News for hackers. Stuff that matters.
Re:The melting pot of JavaScript (2017) by bryanrasmussen on Monday January 07, 2019 @04:13PM (#18850151)
JS or anything that compiles well to JS has a backend advantage that can be hard to beat for an early stage startup and that is reducing the amount of context switching you have to do in changing between languages (especially if your code is isomorphic).

At least, that is how I find it, my productivity shoots up when I don't have to be moving between two imperative languages that most likely share a lot of their syntactical DNA with C but each have their own fun little differences.

Re:The melting pot of JavaScript (2017) by danenania on Monday January 07, 2019 @06:39PM (#18851469)
This advantage is further multiplied with TypeScript, since you can easily share types between backend and frontend. Working with a single set of types that enforce contracts (and supply IDE autocompletion) across the entire stack is amazing. It provides a huge productivity boost and eliminates a whole class of extremely common bugs.
Re:The melting pot of JavaScript (2017) by spricket on Monday January 07, 2019 @04:19PM (#18850225)
I find it's not an issue as long as you're using a decent "object shipping" layer like gRPC. Really greases up the transition point between different languages.

I guess you could hire less proficient engineers which is a sell for startups, but I don't think it's worth the downsides of the current js ecosystem

Re:The melting pot of JavaScript (2017) by TeMPOraL on Monday January 07, 2019 @04:41PM (#18850458)
It's not about RPC, it's about a way of DRYing code between the backend and frontend, using libraries as your copy-paste engine. You pull in the same library (or extract common code to a library) both on the page and on the server, and assume they're both identical.

I have mixed feelings about this. I don't feel comfortable with assuming that just because I use the same library in backend and frontend, I don't have to ensure consistency and behaviour. But then again, I've used this approach in one ClojureScript project (ClojureScript can transpile a lot of Clojure libraries to JS), and it is convenient.

Re:The melting pot of JavaScript (2017) by spricket on Tuesday January 08, 2019 @12:08AM (#18853338)
Needing to copy code around is largely a JS thing IMO. Java has such good standard and third party library support that I don't see what would be that reusable between the front and backend. Except maybe validators, gRPC doesnt support even basic field validation its annoying.
Re:The melting pot of JavaScript (2017) by bryanrasmussen on Monday January 07, 2019 @04:47PM (#18850505)
sure that answers part of the isomorphic problem (but not all), but it still leaves me writing code in two languages that often have lots of similarities in how they look but funny little differences in how they behave that either slow me down or cause me to put in bugs because I'm tired because it's a small startup situation.
Re:The melting pot of JavaScript (2017) by kangoo1707 on Monday January 07, 2019 @05:56PM (#18851133)
JS on both backend and frontend is all about reusability, less context switch and unified toolings.

And don't associate less proficient engineers with Javascript dude !

Re:The melting pot of JavaScript (2017) by spricket on Tuesday January 08, 2019 @12:10AM (#18853342)
Sorry, it's a stereotype, but in my experience JS is a super common first language devs that know JS and nothing else are less experienced.
Re:The melting pot of JavaScript (2017) by pjmlp on Tuesday January 08, 2019 @03:18AM (#18854121)
Other than form validation, I never wrote the same code for both sides.

And that is only when not using JSF, Spring, Forms, MVC, Liferay, Sitecore, which generate the JavaScript validators automatically from type annotations anyway.

For my projects, the Web layer is only the View part of MVC.

Re:The melting pot of JavaScript (2017) by bryanrasmussen on Tuesday January 08, 2019 @03:30AM (#18854173)
For a few things I've worked on Views can be rendered client side or server side.

Aside from form validation I find I might have a number of utility functions that are used on both layers.

I find there are a few other edge cases, but those are the most common situations where reuse is nice (on the other hand what I often do for personal projects is just build the server side and client side code from a gulp pipeline and not worry about needing 'isomorphic' code reuse, but often teams on paid for projects find this approach confusing)