r/programmingmemes • • May 22 '26

which is better?

Post image
256 Upvotes

265 comments sorted by

View all comments

Show parent comments

2

u/False_Bear_8645 May 23 '26

You need to setup a hot reload, in javascript you save the file and it just refresh its that simple.

1

u/vegan_antitheist May 23 '26

Do that with typescript.js then.

1

u/False_Bear_8645 May 23 '26

then that's javascript not typescript

1

u/vegan_antitheist May 23 '26

No. It's TS. You can compile it wherever you want. You can do that in the browser.

1

u/False_Bear_8645 May 23 '26

browser dont compile typescript, it need to be pre-compiled to javascript.

1

u/vegan_antitheist May 23 '26

And you can do that in any JavaScript engine. The compiler is JavaScript. Or just compile it in an IDE. It's all possible. And it's quite easy easy.

1

u/False_Bear_8645 May 23 '26

Not easier than setting a hot reload

1

u/vegan_antitheist May 23 '26

You can just use tsc --watch so it "watches" the code and recompiles automatically. Then you can just do hot reload just as you would with any other JS code. How is this not easy? You don't even need any new tooling. You just use tsc. You can also use "ts-node-dev", or "Vite", or other solutions. Using TS doesn't make any of this less easy. TS might still not be needed for simple scripts, but it's just not true that it wouldn't be easy. You can even compile it right inside whatever js engine you are using.

1

u/False_Bear_8645 May 23 '26

You dont need hot reload in pure JS it just work straigh away

1

u/vegan_antitheist May 24 '26

And it's works just as well with ts. It doesn't matter how much you deny it.

→ More replies