This improvement is too simple to introduce bugs, the only problem to think about is if we would like to use this method with every Array like variable or just Arrays.
In any case conditional comments are not more robust, neither simpler to maintain. First of all they are comments, almost every editor will gray out that part and sometimes with different fonts/colors/indentation Secondly they requires extra checks for every kind of compressor/munger/minifier Third they are not standard and being Microsoft a software house able to change its mind without caring that much about broken features, who knows if IE.Next will still support these horrible comments. Fourth, Opera suffers identity crisis, it emulates some IE behavior (attachEvent and others) and who knows if tomorrow Opera will introduce conditional comments supports as well. Finally, I consider conditional comments an easy way to solve the problem as !"\v1" is to check if a browser is IE or not but I would never create a library entirely based on conditional comments because the day these will be different, it does not matter how, I will have to change 60% of the library and start again with tests, debugs, etc etc. What I mean is that I would use an isIE flag rather than develop a library that is 60% commented out. With a flag, we have less code (no open / close comments) and a single place to change the logic, if necessary, whatever the future will reserve. Just my opinion, but I would like to receive an answer from jQuery devs about my proposal without creating another "thousands of Off Topics" discussion, tanks. Regards On Fri, Sep 4, 2009 at 12:15 PM, DBJDBJ <dbj...@gmail.com> wrote: > > @Andrea: fair enough ;o) > I will also re-emphasize one (I think) important point here : > Optimisation is NOT just about speed. It is also about stability. > How is above improving the stability? Well, the code is simpler . > Ok, so what if code is simpler? The existing code is usually very > simple...Well the simple code really helps. "tired fingers" are less > bound to make a mistake. However non-relevant this seems, I think it > is very relevant ...We all know how easy it is to intoruduce > "invisible" bugs in javascript. > > Also: simple code == robust code. > > --DBJ > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---