I honestly think the only real solution is re-doing all of it 'from scratch', to make everything (a) stricter and (b) more normal/consistent.
(I think the extant transpilers/preprocessors tend to try to be too 'thin' of a wrapper around CSS/JS: they do give some nice quality of life features but still don't really clean up the mess that is JS and the DOM.)
A person can be a successful programmer for decades and do millions of HTTP operations without knowing the distinction between TCP and IP.
I've been working in Python for the last several years. There's definitely a learning curve there, and I get frustrated with things all the time, but the whole JavaScript ecosystem seems like such a mess compared to Python.
One of the things I miss the most about Python when working in JavaScript is the documentation. And I mean the core documentation from Python.org. The Tutorial is amazing [0]. And you can download the entire documentation already in PDF. Maybe I'm one of the few, but when I'm learning something new it is such a better process if I can leave my computer and read through a tutorial and mark it up.
That was about 3 years ago, and I just started using modules. Even then, I use the native browser modules, no Webpack. With HTTP2, there is little cost to requesting many small files.
Likewise, I don't use a CSS preprocessor in any of my projects. They aren't that complicated.
Those projects have no build process. What you write is what you run (WYWIWYR?). If the project is small enough I'll serve its root directory with Python's SimpleHttpServer. Later, I might have nginx do it.
This allows me to get a project running in a minute. I add tools when they are needed, because then I have the motivation to learn them and set them up properly.
Such tools are required if you must coordinate the work of multiple developers. Their cost is divided by the number of devs, and their benefits multiplied.
If you're just a home gamer toying around, you can do without them.
of course, if you are new, then this approach may not be obvious
I started using Vue from a script tag a year ago (not that hard). But when I started building an SPA, things got complicated very quickly.
I found myself longing for a really good tutorial similar to Django's [0], rather than the thousand variations of "Today We'll Build a To-Do App in Vue!" that are so common.
For the projects that I work on, I use the same pip/virtualenv setup that I've used for years. Can't imagine that happening with Webpack (Side note: it might be that I could use the same Webpack setup for years, but the unstable reputation around the JS ecosystem makes me think I couldn't).
Javascript runs directly on the browser. That automatically makes it much more complex because:
1. There are some packages written for browser and some for Node.
2. There are transpilers, abstractions layers, bundlers, etc to make packages run on both environments.
3. Browser based packages need to have all sort of backward incompatibilities in mind (from IE6 to now)
Multiply these 2 and 3 together and you'll see why it's a mess of an ecosystem...
Yet, it only takes a little bit of knowledge and experience to get something working. It's hugely productive.
I mean honestly considering the hand dealt with it (decades of backward incompatibility required), I think the js ecosystem is holding up real well.
No she isn't.
This entire thread is full of the generic excuses one has come to expect from this profession when people struggle with programming setup and running programs. Always a defence of the (broken) status quo.
Something has gone wrong? You didn't read the documentation (the incomplete or non-existing documentation). Or it's actually simple, all you need to do is x, y, z followed by a, b, c - how could you not know that? (Often implied in these responses: you're clearly a clueless noob).
This is quite simply a profession that wouldn't recognise 'simple' if it came and bit it on the arse (or ass).
If you think learning NPM is hard, try telling a new dev how to setup a Java or C# build by hand. If you think webpack is hard, try teaching someone the intricacies of make.
What about babel? Other languages make breaking changes and dictate that the new version of code just won't be compatible with older stuff. Python 2/3 wouldn't be a blip on the radar if the same option to transpile between versions existed. Those famous "update your .Net version to whatever" warnings simply wouldn't be needed. Instead, people complain that learning a few lines of config is too difficult.
If people put half the time into learning JS that they put into learning the other languages and build tools they know, there would be almost no complaints because the tooling these days just isn't that bad.
The problem is not one of putting the effort in, it's even knowing where to go.
If I want to learn about how to use some new JS library/utility/webpacker, I can probably find about 30 good-quality-looking blogs/articles/documentation pages on how to do it. Most of them won't work, because they'll be out of date. This is hugely frustrating, because you don't know if it's not working because the documentation is wrong, or because you're holding it wrong.
> If you think learning NPM is hard, try telling a new dev how to setup a Java or C# build by hand. If you think webpack is hard, try teaching someone the intricacies of make.
Make is actually a brilliant example of something that's complex and daunting, but ultimately rewarding. It's easy to put the effort in to learn it because the maintainers don't change their minds every 2 minutes about what the Makefile syntax is, so learning how to use it is pretty straightforward. And once you know it, you can understand makefiles written both yesterday and decades ago.
Give me make over webpack any day of the week. I'll put money on which dies first.
Sometimes I am in the same boat. Thinking, this should be easy, ending up yak shaving.
For all Python's ease of use language wise it‘s ecosystem can be utterly inscrutable.
Python3 -m venv env. That’s all it takes.
She wasn’t helping one of her students, she was helping a friend who is a computer scientist. The closing thought was if this person, with so much existing knowledge and some assistance, can’t make one “simple” thing work in a reasonable timeframe, what hope do actual novices have?
Novices should be referred to preset codesandbox.
There's blame to go around but I mostly blame npm for being full of hot garbage while obscuring what is garbage and hot.
However, I initially learned some Python in university and I liked it then. We just installed Idle and ran some simple scripts, and everything worked. That's the right way to learn a language. If you dive straight into JS package management, you are attempting to learn multiple things at the same time:
* Node.js environment
* Browser environment
* JavaScript syntax
* 'running a localhost'
* JavaScript modules
* NPM package management
You need to tackle these one by one. If you do them all at once, even with prior experience in other languages, of course you're gonna have a bad time.
Really what I take away from this post is that the author is a bad teacher, although the experience of her student is probably similar to what many people experience when trying to learn by themselves.
There are many improvements that could be made to the JS ecosystem, but this post does not do the current state justice. What it highlights, if anything, is a problem with the available of a standardized learning path. But I'm not sure what the solution to that would be.