danilocelic wrote:
Werner Punz wrote:

Well exactly, and in case of earlier prototype versions
the array was broken that way, now if
another library used for(var p in anarray) the for
iterated wrongly.


Thanks for the follow ups Ryan and Werner.

Werner, are you saying that folks use a "for in" loop to iterate over the elements within an array? If so, I'm surprised that anyone would think that a for() loop over the elements in an array would be the same thigns as looping over the properties of an object. Or am I misunderstanding the issue?


Well that is the problem the alteration of object also broke the for loop on the Array, because the basic prototype structures of every
object in the system were altered.

Similar issues could arise at other parts of the lib,
the already fixed iterate over object (and therefore iterate over everything javascript object related) bug just was the most prominent showcase of those issues.


As I said before to me the namespace problem is less problematic
(although having namespaces preallocated for ${} Form etc...
is not too nice either)
but the basic object altering probably is more critical if you
try to use prototype in a somewhat unknown environment (where you
cannot be sure which lib comes along)


I'm not sure which side of the fence I sit at this time, while I can understand that library maintainers should practice denfesive coding techniques to prevent clashes, I can also see that having the flexibility to have base objectys adorned with commonly needed and very useful methods.

I think I have a bit of reading and thinking ahead of me.


As I said, it would be a non issue if you are in an application scope
and have full control over what you do (which most rails programs are)
but given the situation that the lib is intended to be introduced/used
in a component set, which has to coexist with numerous other third party component sets issues like this can be crucial. For now I am still undecided to leave the stuff I have, which is based upon proto (which is not as much as martins) permanently in the sandbox until those issues are resolved or if I should move on to DOJO and forget about proto for now.


So I have the same thinking process currently you want to start ;-)

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to