3 ms·
In JS, modules were a massive improvement pretty much from day one. They were fairly quickly adoped and worked well. It's been a huge quality-of-life improvemen
by m-schuetz 1y ago
In JS, modules were a massive improvement pretty much from day one. They were fairly quickly adoped and worked well. It's been a huge quality-of-life improvement, especially with the latter addition of import maps.
I just wish we'd get working, well-supported modules like that for C++. I tried them once, but support was abysmal and I won't touch them again until they work nicely everywhere.
- pjmlp 1y agoTo be fair, only thanks to JavaScript/TypeScript compilation and polyfills to AMD and CJS pseudo modules approach, only recently has nodejs supported ES6 modules without having to deal with switches.
- m-schuetz 1y agoI've been using modules in nodejs for a very long time. What sucked initially was that you had to use a command line flag at first, and it still sucks that you have to use the mjs extension. Still, those are minor issues compared to the issues modules face in C++. And in browsers, modules worked nicely almost from the start, and since import maps you don't even need to use any kind of build system amymore.
- pjmlp 1y agoLikewise I have been using C++ modules for my C++ hobby coding since VS 2019 prototype introduction, despite all the warts. Nowadays, with exception of header units, VC++ and clang alongside MSBuild and CMake/ninja are pretty much usable for anyone that is able to stick to a specific platform. I don't consider still fighting with build tools options in 2025 to make a pleothora of npm dependencies happy to run under nodejs a minor issue.