4 ms·
I used to feel this way. The two people that changed my mind were John Resig and Douglas Crockford. Resig's jQuery project has been, for me, a guide to how JS
by artlogic 16y ago
I used to feel this way. The two people that changed my mind were John Resig and Douglas Crockford. Resig's jQuery project has been, for me, a guide to how JS should be written. Crockford's JS the Good Parts and JSLint have helped as well by providing some solid reference on what to do and, more importantly, what not to do.
Lots of folks only see the DOM and the bad parts when working with JS - these two projects have shown me there's so much more.
- orangecat 16y agoLots of folks only see the DOM and the bad parts when working with JS Agreed that you can't blame Javascript for the DOM, but there are lots of bad parts aside from that. Default global scope and semioptional semicolons are gigantic WTFs, the with statement should be nuked from orbit, and there are generally lots of ways to write code that appears to be correct but is just waiting to fail in bizarre ways. It's just annoying that we're stuck with Javascript because it's so entrenched, while Python and Ruby offer all of its strengths in much saner packages.
- artlogic 16y agoI believe I did say "and the bad parts". I agree - there are lots of bad parts to JS - I often wish it could be remade without the bad parts. However, a lot of these bad parts can be mitigated with sane conventions - that's what Crockford's "Good Parts" is all about. If you haven't read it, I highly suggest it. I can't speak for Ruby, but in many ways JS is more powerful than Python, especially on the functional side of the house.
- polgardy 16y agojQuery is a great project, but it's definitely NOT how JS should be written. Its goal is to be fast, unobtrusive, and work in most browsers at the expense of comprehensibility.
- artlogic 16y agoI'd argue that jQuery embraces a lot of ideas that new JS programmers often overlook - functions as objects for example. jQuery also gives you primitives to perform functional/set based operations. For me, approaching JS as a functional language has been the key to writing good clean JS. jQuery helped me with this by allowing me to ignore all the psuedo OO stuff in JS and concentrate on the functional features.