HACKER Q&A
📣 singularity2001

Do you think did they broke JavaScript?


coming back to js after a few years I am now facing incompatibilities between require(), import(), import as well as async function coloring. Are these non-issues or is js really falling apart?


  👤 solardev Accepted Answer ✓
JS is terribly messy. There's like 5,000 ways to do the same thing and no one right way. Every framework and transpiler tries to reinvent the wheel, and now we have a highway with like forty thousand types of carts, each with their own wheels.

The require() stuff has fallen out of fashion as projects move to the ESM import style. React is battling it out with Vue and Svelte and HTML Web Components and native server-side components. It will keep changing very quickly for a while... no stability is in sight.

But if you're just coming back and you don't have to support legacy projects, just start with a new Next.js project and it will configure everything for you with sane defaults. It takes care of a lot of the mess you see in JS today.

If you're planning on rolling your own buildchain... eh... good luck.

For simpler sites you might not need any framework or toolchain at all. ECMAscript is pretty good since ES6, or you can use React without a toolchain too.

But yeah, it's a mess, especially if you have any experience with languages that aren't so... insane.


👤 samoit
Javascript is a script language that is being used in areas it should not be. In the context of the browser was ok. Node change the context but not the tool. When I was in the web development area it was horrible, new frameworks every week, every new one trying to fix something that javascript could not do "easily", changes with incompatibilities, etc. When you need another language (aka typescript) to fix (some) of the flaws of it...well it should mean something. I have always thought that javascript is a mess and sad that many developers grow with it.

👤 ChrisAntaki
It's getting better every year, in my opinion, though sometimes it has growing pains

👤 jdlshore
Not a big deal, no.

👤 programmer_dude
*break