The title says it all. What change will you make to JS to make it easier to code and understand from today's perspective. Would you for example:
- Add classes and proper inheritance?
- Have support for namespaces?
- Support for static types?
- Built-in runtime for various tasks?
Top comments (5)
Perhaps just,
Just make Javascript less of a minefield is most important.
Indeed, Javascript did tried its best to prevent UI from crashing, but it failed more than sometimes.
It did somewhat succeed in preventing UI for hanging, though.
A standard library
Should utility libraries be centralized? However, I think Node.js and web browsers are vastly different.
I actually think towards smaller size of global object. And only import when needed.
A standard library would ease a lot of problems like huge node_modules with hundreds of similar utility packages and as many similar but different approaches to solve the same problems. I mean, a standard library, like that on Python or PHP.
Now that I think about it, some other cool things would be having a single type of file module (no more ASM and CommonJS) and import/export syntax, as well as avoid any unwanted context binding (like with the old
function
syntax)Now that I think what it actually does IRL.
I would argue that "A standard library would ease a lot of problems like huge node_modules" isn't real. The approach is whether you will use isolated environment or not. Also there is a solution in Node.js world, like pnpm, but is it against Node.js's philosophy?