3 ms·
Probably, but don't blame me, I just test how jQuery actually builds elements, because people do build elements this way from time to time. But don't count it
by MadRabbit 17y ago
Probably, but don't blame me, I just test how jQuery actually builds elements, because people do build elements this way from time to time.
But don't count it if you don't like the idea, it's just one test among many others and not the slowest one. So it won't change a lot.
- catch23 17y agoWell the reason jQuery rose to popularity had nothing to do with its speed. jQuery is a bit of a pseudo-dsl for dealing with dom manipulation. Sure it's a ton faster if you just did it with pure dom, but I think if you considered the development time required as part of your benchmark, you might see jQuery come out on top.
- MadRabbit 17y agothe benchmark is just a proof o point, nothing else. and certainly I know why jQuery is popular. But as for the second part, I don't see any difference in coding efforts between jQuery and RightJS, if you really read the tests on github, you will see the size of code is about the same, RightJS is even compacter in many places.
- veemjeem 17y agocode size is rarely a good indication of productivity in a framework. There's lots of frameworks that allows the developer to have a smaller code size but few actually make it more fun for the developer to work in. I'd say jQuery is popular simply due to their Sizzle library which is now in many other frameworks. It may be slow, but it sure is fun to work with. I'd also like to note that it's quite nice that jQuery does not mess with classes directly, or with prototype. Although it certainly is cool to add additional methods there, javascript doesn't have a great way to namespace stuff added to global classes and makes it a pain when you mix & match other JS libraries into your project.
- MadRabbit 17y agoYou're saying right things about jQuery, but you seem like don't know a thing about RightJS, because it has its own nice features and most people who actually tried it for real, said that it is more comfortable and fun to work with than jQuery. As for the safe mode, first of all it's not such a big problem as people usually think and actually provides more help than issues, and secondly RightJS will end up with a safe mode plugin sooner or later.
- veemjeem 17y agoI do think you should consider adding a safe mode sooner rather than later. It's actually a bigger problem than you might think. My mentor generally won't care too much if I use a 3rd party js library as long as it doesn't interfere with other company libraries (which do put functions on Array.prototype/Object.prototype). I'm guessing that other people working at large companies may not be able to use your library for this reason.
- MadRabbit 17y agoI know about the problem. RightJS is extra careful with native classes extensions, it adds only standard methods and doesn't extend the Object.prototype at all. In many cases it's just adds missing methods in old browsers and that's it. And we always keep the original functionality intact. We're trying to balance between the Prototype extensions hell and jQuery agnosticism. Things like String#endsWith, Array#compact is kinda standard features, they are extremely handy in everyday work and most of soberminded programmers won't hack those methods if they create some plugin that other people might use. As the matter of fact most of jQuery plugins don't extend prototype too. So it is a problem, but I believe it's negotiable and there might be a non-polar solution.