by magicmouse · 8y ago · 0 comments
It's a tour of how all the best discoveries of the past decade or two really date back to the 1960s.
[1]https://www.youtube.com/watch?v=otAcmD6XEEE https://www.youtube.com/watch?v=otAcmD6XEEE
It was easy so many people could start their dev career with it.
But one day even PHP matured, so give JS a few years.
It's like Babel and Webpack where you incur time spent on debugging your own tooling and getting these systems to collaborate. By the time I put in the effort, I decided it was simpler to go all in and use a compile-to-JS language instead of something that tried to be Javascript with types.
The fact that it requires a build step turns out not to matter because everyone uses a babel / webpack pipeline anyway, so all that same complexity is there for regular javascript as well.
And it also lazy loads the module. ES6 modules might be a 44 years old standard, but NodeJS modules are better !
For use on the web the web server could grep require from the source and push modules to the browser, so when a module is required it will be loaded from cache. The browser could even pre-parse the module to speed up run-time for when it's required.
Nope. The server can’t figure out which modules are needed unless it runs the program:
if (isPrime(366226717)) {
require(“hugeModule”)
}