3 ms·
> Tracking down things in JS is a timesuck of epic proportions. I think you mean your codebase rather than JS. There are plenty of industrial JS codebases wher
by yid 10y ago
> Tracking down things in JS is a timesuck of epic proportions.
I think you mean your codebase rather than JS. There are plenty of industrial JS codebases where this is not a problem.
- amorphid 10y agoI'll be the first to confess I'm not a JS wizard. That being said, it'd be nice for the following to be easier: * 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.
- yid 10y agoNot to be too pedantic, but most of those things have nothing to do with JS. > 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.