The webdev ecosystem is so broken, it's no wonder so many websites deliver assets that are extremely suboptimally optimised, big unused blobs of assets /scripts slowing page load, optimising it all is actually made harder than coding it all.
The webdev ecosystem is so broken, it's no wonder so many websites deliver assets that are extremely suboptimally optimised, big unused blobs of assets /scripts slowing page load, optimising it all is actually made harder than coding it all.
It... really doesn't? You generally have an entry point file - which can be any file, you just have to specify it to your build system - and import statements are followed from there on. If anything you could argue the JS build ecosystem is too flexible (which is one of the things esbuild is pushing back against). I've never heard someone criticize it for being too opinionated.
> For extra fun, some libraries don't build with build system a, others require build system b
I've literally never encountered this problem. Library authors virtually always ship least-common-denominator JS that will work without using a build system at all, and then build systems know how to handle lots of different variations of JS and converge them into a single representation. Compatibility is not an issue that exists in my experience.
> The webdev ecosystem is so broken, it's no wonder so many websites deliver assets that are extremely suboptimally optimised, big unused blobs of assets /scripts slowing page load, optimising it all is actually made harder than coding it all.
Now you're just airing your own personal beef which doesn't actually have anything to do with the original topic.
I don‘t mean to discuss which system is too complicated and which is not just to point out a lot of real world build systems are on that level.
Gradle wrapper is just a name for a script (automatically created by Gradle btw) which allows one not to have any kind of Gradle-related tooling installed on the machine (basically, to run build tasks you execute `./gradlew someTask`, and it takes care about downloading and running the appropriate Gradle version) - which I think is a clear benefit over the fact that you need to have `npm` installed system-wide or via a tool like NVM in order to build JS projects.
Gradle has its own warts, and a lot of them, but at least there is only one major build system in this area, and it is simply impossible for a library published to a Maven repo to be dependent on the build system it is built with.
I wouldn’t give up all my structural type inference for the 1:1 you’re describing, but it is tempting.
I added the dependency by writing about three CMake lines.
And after that, it just works, for years.
I may have to add from 2, to 5 dependencies for a project, instead of the myriad of dependencies in JS. And they don't become obsolete and need an update each week.
It's a difference of some orders of magnitude, both in number and in upgrade frequency. This is a huge part of dependency management for me.
And there are C++ package managers like Conan, which solve your requirement of adding a dependency by just using the command line.
I will probably use Conan if I have to write C++ again.
Conan makes much of this easier, but is not really suited for large software projects with the problems mentioned above - in my experience.
About dependencies, if they can be found in the package manager then it goes that way. Else, they are a git submodule.
The most problematic has indeed been the C++ MySQL connector, because it has changed a bit over the last five years, so I had to edit the #include lines in the source code files.
When you are using git submodules as package manager, what do you do if the dependency doesn’t come with CMake files, but with autotools for example?
I think bazel is becoming a great solution for these problems if you align with their philosophy.
Allow me to correct this statement: The Javascript ecosystem is so broken.
Working with Clojurescript and Elm is an experience that will make most developers fall in love with web development again.
ClojureScript and Elm aren’t compile-to-JS languages for the sake of doing something weird, there’s just literally nothing else that will run in a browser (except wasm but probably best not to get into that).
Different programming languages exist for a multitude of valid reasons, the compiled output isn’t particularly important as long as it can express everything you need it to.
It would be if machine code were another high-level text-based language completely unrelated to either Lisp or Haskell with its own semantics, execution model and type system rather than a more directly machine-readable format of those languages themselves.
Javascript is fundamentally different enough from a bytecode for any arbitrary language that, at least to me the distinction matters. I can accept that it works well enough that most people don't care, even though I suspect most of the use cases for doing so (error checking, type checking) could be better served with linters or editor tools for JS itself.
But the decision to avoid actually writing javascript at all costs has contributed a great deal of complexity in the JS ecosystem, which translates into the bloat in the web that everyone complains about, because all of that javascript is wasting time and cycles simulating other languages.
Who's JavaScript is it anyway? ES7? ES6? Internet Explorer 11's? How do you isolate things for the sake of unit tests and then bring them together into a performant build?
Cross-browser compatible Javascript was a solved problem when JQuery and shimming came along.
>How do you isolate things for the sake of unit tests and then bring them together into a performant build?
Use one of the many unit testing libraries and frameworks that already exist for Javascript.
Webdev can be broken, but doesn't have to be. I am currently having fun & feeling productive on both a large team project and some small personal projects.