6 ms·
I feel like it's less Javascript that's eating the world and more Node and NPM. It seems as if it's impossible to publish a Javascript project without taking f
by krapp 9y ago
I feel like it's less Javascript that's eating the world and more Node and NPM.
It seems as if it's impossible to publish a Javascript project without taking for granted that the developer has, or even wants, a package manager with dependencies, arbitrary toolchain and transpiler along with it.
Maybe I'm just a dinosaur for not wanting my "build process" for javascript to be more complicated than including a script tag. That's probably what it is.
- megamindbrian 9y agoIt gets easier once you get use to it. The output is a plain script tag include. Aot is one of the most amazing things I have seen. I can tell when an app uses it and when it is slow.
- ix-hispana 9y agoDo you mean to tell me my 5000 lines script is no longer acceptable?
- egeozcan 9y agoYou can use unpkg[1] or other similar services to download or even directly embed scripts from npm. Great for testing. [1]: https://unpkg.com https://unpkg.com
- deleted 9y ago[deleted]
- alayek 9y agoThe way to look at it, is that browser is a target runtime platform. When you write code in a team, you optimize for readability, maintainability etc. You spread your code over 5 directories, 50 subdirectories, 3000 files. When you want to run this in a browser environment, it needs to be optimized for delivery - faster download, less time-to-be-interactive. You need to split your JS codebase as per routes in your app, and load chunks as per user demand. Not just JS, you'd have to compile and inline your CSS, base-64 encode your images to data-urls, generate image stripes. Before all these, you'd have to lint your code, and run unit tests on your code. I fail to see how you can do all these with just a script tag. You need some sort of a compiler / transpiler; and a task runner that gives you a handy interface to these. The package manager has no dependency, other than the Node runtime itself. As for arbitrary toolchain, the metadata is codified with semantic versions in your package.json. You're one install step away from downloading all the necessary packages. One thing I think lot of Node project misses, is to not add which Node version is to be used. It's not because it's impossible to do that - there are two well documented ways to do that (via .nvmrc and "engines" entry in package.json)
- paulddraper 9y agoAgreed. 90% of the complexity of JS has to do with loading, in some form or another. You can't deliver 100MB application to your end user.
- tedunangst 9y agoThis sounds a lot like how it's possible to fit a square peg in a round hole if you have the right drills and grinders and so on.
- enraged_camel 9y agoThat's exactly what it is. The fundamental issue is that the overwhelming majority of interactive websites today don't actually need to be interactive, and may even be better off as old-fashioned HTML pages served by the server. But people love over-complicating stuff, and when the end result is complex the toolchain has to be complex too, not just for one person but the whole team. Then you end up with developers who spend more time wrestling with webpack et al than working on actual features.
- whatever_dude 9y agoLike anything new-but-different in tech, it's probably a matter of using it for a while until you see the benefits. I used to prefer a 0-dependency, no-build format for sites. Nowadays if something doesn't have an npm module it's enough for me to not want to use it for a variety of reasons. I used to install "dependencies" by copy and paste and was happy, but because I didn't know how it could be better. Despite all of npm's woes (which are many) the concept is sound, and not just for JavaScript.
- dirkc 9y agoI felt frustrated by the typical Node toolchain until I remembered the typical Qt toolchain for developing cross-platform desktop apps. I can't remember everything, but here goes. To compile a Qt app you need: - the meta object compiler (moc) to add dynamic features to C++ for Qt use - the Resource Compiler (rcc) to embed icons or sounds as arrays in header files - the Qt Quick Compiler if you are using QML files for your interface - the C++ compiler, linker, etc. This is either driven by CMake, qmake or your IDE!! I see you can use Qbs to generate the CMake or qmake files! I remember learning CMake, make, ant, etc being non-trivial! Oh, and you were on your own when it comes to dependencies!
- quacker 9y agoI think it's more accurate to compare Node to C++, compare NPM to apt/yum/etc+CMake, and compare something like Electron to Qt. Of course, your point still stands. But's a tradeoff. C++/Qt has a ton of compile-time bloat, while Node/Electron has runtime bloat (see the Slack client using hundreds of megs of ram). And you can use bindings, like PyQt, where you have Python/Qt and then you get Python's dependency management.
- thehardsphere 9y agoCompile-time bloat and runtime bloat are not equivalent. Runtime bloat inflicts pain upon users and therefore is usually worse.
- softawre 9y agoYes.. Don't you think that's why he bothered mentioning the words "runtime" and "compile-time"?
- thehardsphere 9y agoWell, the way I read what he wrote was that he was suggesting that bloat is bloat wherever it happens so that it's all a wash.
- 9y ago
- k__ 9y agoAlso, it seems highly unstable. Just look at all the Node.js drama. Today I read they want to fork again, while they just consolidated their last fork...
- thehardsphere 9y agoIs that the fork about the one contributor who annoyed some people on Twitter? Because that fork isn't worth paying any attention to; it's not going to go anywhere because it's pure politics.
- OtterCoder 9y agoOh, this fork isn't in earnest. It's being overhyped because it's a select few people throwing a tantrum about ableism in the absence of any actual malice. There's no actual instability in the platform itself this time.