That “if” part carries a lot of weight. There’s a whole branch of questions around the quality and suitability of tools available - for example, I was surprised when we hired a couple of JS specialists and their Next.JS project left me surprised to see how many areas it was behind Django circa a decade ago when it came to basic things like performance, authentication, internationalization, etc. and that massive tool chain soaked up a good chunk of time on an ongoing basis.
The deeper question is how often you actually benefit from code reuse. There are certainly some areas where you can share things but you also run into a lot of coordination concerns because the environment for JS in a browser is not the same as in Node, which increases the friction of sharing, and a large chunk of the benefits are things like data validation which can also be substantially eased with things like JSON Schema. Simplifying those test matrices and formalizing your boundaries has more value than I tend to assume at first.
Depends. I hate the whole JS ecosystem and NPM hell so if I can get away, I do. I can never go for JS on the backend personally. I am happy with good old PHP, Go, Python etc.
If you're a one man show, I think it's a fair argument.
With more people working on it, like typical companies, it doesn't hold a ton of water. Every language has its place to where it's best suited. You can get a more performant, better structured, and safer backend in other languages.
In typical organizations, you always have a grizzled backend developer well-versed in creating REST backends in Java and a frontend developer well-versed in whatever. So you play to their strengths.
The deeper question is how often you actually benefit from code reuse. There are certainly some areas where you can share things but you also run into a lot of coordination concerns because the environment for JS in a browser is not the same as in Node, which increases the friction of sharing, and a large chunk of the benefits are things like data validation which can also be substantially eased with things like JSON Schema. Simplifying those test matrices and formalizing your boundaries has more value than I tend to assume at first.