You missed the point. Well, several points. My Library was written years ago and the idea was to support "ancient" browsers like Safari 2 as well as all future browsers. As the fairly torturous test page still works in IE8 (all modes), Safari 4 and Chrome it would seem a rousing success. In the meantime, jQuery has been virtually rewritten to get rid of the browser sniffing. Guess where they got the ideas (and figure they botched their implementation).
Yes, memorizing camelized styles would be more efficient, but then the library doesn't deal with hyphenated ones in the first place. It's used in exactly two places and neither has anything to do with styles. Instead, it deals with (very rarely encountered) hyphenated _attributes_ (you should have guessed, or God forbid read the code you were criticizing).
And aren't you just picking one (tiny) bit that you can sort of relate to and mouthing off without any real clue about what you are talking about? <whine>And why didn't _you_ report it to the author to be constructive, build a community, etc. What an awful jerk!</whine>
BTW, your version will blow up in Safari 2 due to the function passed to replace. Good luck with that!
Hi, welcome to HN! I sincerely hope that you will bring a different tone here than you do on comp.lang.javascript.
People tend to measure the "success" of their libraries or other code based upon whether or not it accomplishes their goals. If your goal was to simply build a set of abstractions, continue support for ancient browsers, and ensure that it continues to work for future browsers, then you've accomplished it and that's great.
However, you fail then to recognize the goals of other frameworks and libraries which differ from your own. That is, they sacrifice compatibility with very old browsers for the sake of improved performance and support for newer browsers; or they sacrifice strict correctness for improved rates of development; or they sacrifice other aspects of Javascript-specific techniques for the sake of readability or establishing patterns familiar to novice programmers.
The authors of other frameworks can no more be criticized by you for failing to meet your goals, than we could criticize your library for failing to meet our goals.
Indeed, you're correct that I did not read every one of your more than 9,000 lines of code (almost 330K!) for the complete library. Rather, given your penchant for reading a few lines of some framework, critiquing them, and then declaring them to be no longer worth your time -- I thought I'd try the same.
...Actually, I'm being needlessly rude there. The truth is, I did attempt to review portions of code inasmuch as I had time for. Much of it was simply not notable; I picked out the camelization for one point because I had been tuning my own just a few nights ago.
Thanks (seriously) for pointing out the Safari 2 incompatibility. I'll consider whether adding support for Safari 2 is worth re-working that line. (Probably not, but maybe.)
We could continue to dicker back and forth on the relative merits of one bit of JavaScript versus another, but I'd rather keep working on mine, other people would rather start writing their own obvious unit tests, and you would hopefully rather update your library or something.
You don't get it. See the examples I posted recently in CLJ (at the end of that jQuery thread, for example). It does anything you can imagine, including a jQuery-like interface if you really like bad interfaces. :) Or you can write your own OO interface.
jQuery is _downstream_ from My Library. If you go back a couple of years in CLJ, you'll find that I'm the one who tirelessly argued with Resig and co. until they dumped UA sniffing. And yeah, they copy code and ideas from me to this day. But that is _not_ why I point out the botched implementations of those (and other) ideas. I point them out because the code is bullshit.
All of that stuff about improved development time and readability and support for whatever browsers misses the mark (no pun intended) as well.
* The others are not more readable
* The others are not more advanced (despite my Write Once, Do Nothing strategy).
* The others are not more compatible (not even close)
* The others do not perform better
* The others do not have better support (the authors are too confused about what they are writing or copying)
The only thing the others have going for them is that they actually (disingenuously) market their projects. I don't have the time or need to do so.
The library is only 330K if you select _everything_ in the builder, which is the equivalent of jQuery + 100 plug-ins. It's got easily the best Flash module, a unique audio module, "sidebar" widgets, a CSS selector query engine, animations (including DirectX), etc., etc. And it all works going back a decade or so and continues to work going forward (I rarely touch it). And contrary to the laughable comment I saw in here, it perfectly suitable for use in the "Real World". That expression is so tired (and meaningless usually) it is in a coma. I sometimes wonder if the people who write things like "Real World" and "snark" actually talk like that. :)
I don't know what you mean by "simply not notable". On technical, usability and compatibility merits, it's the most notable blob of cross-browser JS ever published. But I never really called attention to it other than as a way for others (e.g. Resig) to learn. When it came out, all of the frameworks were doing crap like this:-
if (isIE6) {
} else if (isSafari || isIE8)
}
...and about to collapse under the weight of all of these flaky forks. You can't maintain BS like that.
Read your history, you will get an extreme sense of Deja Vu (and perhaps a laugh or two).
And I never said anything about Resig co-opting my "obvious unit tests". There's a lot more than tests on that page. Nor do I have to update My Library (that's the main point of feature testing).
Seriously, you just might learn something. This is why I speak loudly (and carry a big script). :) Otherwise, all of you "hackers" might have remained oblivious to the fact that jQuery, Prototype, MooTools, etc. are Z-grade scripts at best. It's not always a poor use of the language, but more often a poor grasp of cross-browser scripting techniques, which leads to endless Beta tests, wholesale substitutions, etc. It's a relatively hard way to go, despite what the commercials (blog posts) tell you. ;)
Yes, memorizing camelized styles would be more efficient, but then the library doesn't deal with hyphenated ones in the first place. It's used in exactly two places and neither has anything to do with styles. Instead, it deals with (very rarely encountered) hyphenated _attributes_ (you should have guessed, or God forbid read the code you were criticizing).
And aren't you just picking one (tiny) bit that you can sort of relate to and mouthing off without any real clue about what you are talking about? <whine>And why didn't _you_ report it to the author to be constructive, build a community, etc. What an awful jerk!</whine>
BTW, your version will blow up in Safari 2 due to the function passed to replace. Good luck with that!