Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Comment Re:Weaknesses of "prototype.js" (Score 1) 255

Why should a a JavaScript framework NEVER define methods on Object.prototype or Array.prototype? Code that requires a static definition of Array is clearly making incorrect assumptions about how the language is used, so I'd place the blame there, not with prototype.js.

Most people treat JavaScript like its C's retarded little brother, but that's just one of many programming styles that it adapts to. Methods like Array.each and Array.grep allow JavaScript to be used in a very Ruby-like fashion, which, in addition to making the language more comfortable for its target audience, usually results in tighter, more readable code. Extending Array and Object might lead to some exciting bugs in code that doesn't expect it, but I don't see how this makes the practice wholesale wrong. Ruby on Rails does stuff like this all over the place. Being able to say 3.months.ago or some_random_object.to_json is part of what makes Rails such a pleasure to work with, and I don't see why its JavaScript library shouldn't be extended the same freedoms.

To quickly address your other two issues, I got all the documentation I ever needed from this site, and, while unit tests are definitely nice, prototype's proven track record is enough for me. I haven't had the slightest bit of trouble with prototype -- it's done nothing but save me time thus far.

Slashdot Top Deals

fortune: cannot execute. Out of cookies.

Working...