Skip to content

Comment on Ask HN: Changing my mind about JavaScript

Comments

My (unpopular?) take is that JavaScript should suffice.

Once I feel the need for TypeScript, I've done something wrong. For example, built my whole frontend with JavaScript or built my backend in JavaScript.

JavaScript's use case for me is sprinkling it where needed in browser. Anything extra and it feels wrong tool for the job.

Frankly, I believe whole existence of TypeScript is a mistake – we should've never used JavaScript at a scale where static typing becomes necessary.

Having said all that, I'd love to be able to write gradually typed JavaScript (i.e. TypeScript) in the browser. Gradual typing is still greatly beneficial, even in my sprinkles.

How would you not build the whole frontend in JS though? Use another compile-to-JS language?

Render most of the frontend server-side and just use JavaScript for the dynamic bits only, I guess? I personally haven't done it like this since the advent of SPAs, but I'm guessing lots of things are still built like this.

It *should* still be the default.

I urge you to check out https://hypermedia.systems/ (free to read online).

TL;DR: The web platform has evolved (and continues to evolve) so much that I don't see a need to use SPAs for the majority of web applications.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.