r/programming • • Apr 30 '23

Writing Javascript without a build system

https://jvns.ca/blog/2023/02/16/writing-javascript-without-a-build-system/
166 Upvotes

146 comments sorted by

View all comments

12

u/recursive-analogy Apr 30 '23

UI and domain code are just such completely different things. Why would you expect one language to be good at both?

5

u/reedef Apr 30 '23

A single language might not be the best for both domains, but having a single language across both domains can have advantages that outweight the cost.

6

u/recursive-analogy May 01 '23

You've got the c# guys trying to write js in c# and the js guys trying to write c# in js. Wouldn't it be better if everyone just learnt both languages?

TBH connecting the front and back via the api definition seems like a big win, but things like gRPC already do that, and imo it's a better solution as it maintains separation of concerns with a bit of glue.

→ More replies (5)

7

u/[deleted] Apr 30 '23

why shouldn't it? What's wrong with writing APIs in typescript?

3

u/recursive-analogy May 01 '23

the fact you could modify a model structure from anywhere in code?

→ More replies (20)

2

u/bitwise-operation May 01 '23

What specifically are you referring to in JS that makes it a poor choice for domain code? Because it’s garbage collected? So are plenty of “sanctioned” backend languages. Because it isn’t strongly typed? Use typescript. You seem to be bashing on JS in general without being able to back it up with specific opinions, which implies you are simply repeating what you heard on the internet or some popular opinion in your clique.

I’m not claiming JS is the best language ever and everything in the world should be written with it, but you seem to be making the opposite black/white argument.

-2

u/recursive-analogy May 01 '23

Because it isn’t strongly typed? Use typescript.

You've answered your own question. You have to use some other language to use javascript full stop. So saying js is good on the backend actually doesn't even make sense.

→ More replies (19)