Hacker News new | ask | show | jobs
by lukan 2 days ago
"We all (hopefully) know the world would be a better place with less JS but you can't put the genie back in the bottle."

I don't know that.

I suspect you hate javascript because so many ads and tracking software is written with it? Replace JS with something better and the ads will just be written in that.

Otherwise JS .. works and is simple. And compiling any language to wasm very doable nowdays. What would be the alternative?

(Personally I would like to see TS native in the browser)

3 comments

"works and is simple"? You can argue JS works by definition because it is what people use, but it is far from simple -- JS and C++ are basically the only two programming languages where books plead with you not to use all their features but use a more maintainable subset.
It is simple as in people use succesfully javascript who have no idea what programming is.
Reasons vary per person but personally it's more about bloat. JS as it's used today is very different compared to its initial use case. We build entire applications in JS now, which is cool, but we do this by treating JS as a build target. The code we write is not executed as-is by the browser, it is transpiled and bundled up first. It's way too late to change now but I'd prefer something that embraced application development so that you don't need to pull in React/Vue/whatever and do all of this. Something more opinionated like what we use for native apps, but with the flexibility of HTML+CSS.
I mainly hate JS because when I go on the web I want to view documents with maybe simple forms for interaction and not complex applications. It's not the implementation that's the problem but giving websites compute capability without explicit permission.