I don't mind MY JavaScript. It's everyone else's that drives me bonkers. Tracking down things in JS is a timesuck of epic proportions. Much of the time, it just isnt't any fun.
I don't mind MY JavaScript. It's everyone else's that drives me bonkers. Tracking down things in JS is a timesuck of epic proportions. Much of the time, it just isnt't any fun.
You should look into typescript, it has helped us quite a lot with that particular matter.
I think you mean your codebase rather than JS. There are plenty of industrial JS codebases where this is not a problem.
* figuring out which events are listening to a given DOM element at any given time
* sane debugging for things Facebook Coonnect, which had a really confusing implementation at my last company
* no magically defined functions or variables (i.e. foo["bar"+ someId] = eval("function () {...}")
* keeping CSS out of JS, and JS out of HTML
* dealing with features tightly coupled to an ancient jQuery plug-in
I could go on forever... JS isn't necessarily that bad, but the way people use it is often suboptimal.
> figuring out which events are listening to a given DOM element at any given time
This is part of the DOM Specification, not JS. You may be using JS to manipulate and listen to the DOM, but the reason that browsers don't support doing thing X natively is because the DOM Specification does not specify it.
> * sane debugging for things Facebook Coonnect, which had a really confusing implementation at my last company
Again, this is about a Facebook client library, not Javascript.
> * no magically defined functions or variables (i.e. foo["bar"+ someId] = eval("function () {...}")
If you mean the use of eval to change the runtime environment, pretty much every dynamic language supports some form of eval. It would also be impossible to write certain types of code without eval.
> * keeping CSS out of JS, and JS out of HTML
Not sure how this is a criticism of JS.
> * dealing with features tightly coupled to an ancient jQuery plug-in
Again, this is a common software engineering problem, and has nothing to do with Javascript.
I think you've illustrated some of the reasons that Javascript is so apparently unpopular -- often (but not always) people reference some aspect of the DOM, or jQuery, or whatever vendor-hacked snippets from the late 90s that they remember, without considering that the "bad" parts of the language are by now well known, and there exist extremely efficient and standards-compliant, double-JIT'ed runtimes for JS.