On Feb 18, 3:05 pm, "Martin Ellis" <[EMAIL PROTECTED]> wrote: > Why cant prototype have elegant code and optimised code. I'm not > talking about milliseconds of optimisation, even i am not that > machocistic. > > But when a function gets so much use like setStyle, should > asthetically pleasing code give way to optimisations to save seconds > or even minutes. > Code can still 'look good' and be fast.
I'm pretty sure that's exactly what I said. Both Mislav and I have acknowledged that Element.setStyle does not perform as well as it could. On top of which it's not very "pretty" to begin with. > Slightly OT, but to Douglas Crockford said something on the lines of, > javascript has emense expressive power which allows you to make > javascript feel like any other language. But instead of trying to make > javascript something it isnt, use it for what it is. > > I might have got it a tad wrong, but i hope you get the idea of what i > am trying to say. > > When i write javascript i write it so that it is beautiful javascript. > Not beautiful java, python or ruby. > [...] > Can't prototype.js be elegant without it looking like ruby code? >From almost the beginning, Prototype's philosophy has been to make JavaScript feel Rubyish. If this bothers you, you're using the wrong framework. I don't feel that Prototype makes JavaScript into "something it isn't," though. I don't feel that any of Prototype's Rubyish qualities are gratuitous or tacked-on. I think that Prototype is successful as a framework because Ruby and JavaScript have compatible philosophies and compatible expressive power. Put another way, JavaScript is a "multi-paradigm" language. If you don't believe me, compare Dojo code to jQuery code and see for yourself. To make JavaScript into "something it isn't" would be to shackle it within the confines of a less dynamic language like Java. > i would guess 99% of the people who use the prototype library dont > care about the innards, they infact dont even realise prototype > exists, most users (i.e RoR users) just have <%= > javascript_includes :defaults %> > > and dont look any further than that. Even if this were true, I don't understand why that vast majority should influence the coding style of Prototype. Cheers, Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---