On Jun 29, 8:50 am, astecomm <[EMAIL PROTECTED]> wrote: > Hello, > [snip] > > What do you think about it? Is there any way to avoid this > "incompatibility" with existent JS code in my web app? Is prototype a > good way to do things only if you wanna make your app from 0? > > Regards, > > R.R. Libera
I find it funny that the author would write something like this : "So I simply had to reject prototype.js because, out of the box, the very first time I tried to use it - it snuck out and cut the throat of the JavaScript I was using that relied on performing a for(x in object) on the contents of an Array." Because, from my perspective, you do not adopt a javascript library for only a small part of it. To be more precise, of course you will run into code refactoring when you start using a new library in a project. This is not wanted, but the library often provides simpler ways to perform a task you already defined. The for...in loop is an example. And especially with Javascript, adopting a coding style will play an important role when extending, debugging, and refactoring scripts. Personally, I think it was about time that a community based framework was developped for Javascript. And it is somehow ironic, because Prototype provides an API to do exactly what the author of that blog is whining about ; offer an abstraction layer over all those non- standard browser implementations of the ECMAScript specifications. And in my opinion, I think Prototype is complete enough to use it by itself in a project. Though I extended the API myself a little, I mostly concentrate on JS injections and Web components. Now, if only all browsers would implement CSS in a standard way ! As a final note, I once considered another Web2.0-like library which has plenty of plugins and extensions : JQuery (http:// jquery.com/) ...and guess what ? It IS compatible with Prototype. But while both libraries have the same functionalities, they aproach the DOM differently. My advice, for a project, is to choose a good and active library, one you're the most confortable with, stick with it, and avoid adopting multiple coding style. Some people like YUI (http:// developer.yahoo.com/yui/), but I don't. It doesn't make it a bad framework. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
