My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ImplementationDetails  
why things have been implemented like that.
Updated Feb 4, 2010 by zwetan

As with any libraries some tough choices had to be made, I completely assume any of them, and I will try here to explain those choices.

The main controverse I expect is the dynamic modification of the build-in objects, some will say it's bad practice, some others will say it's a dumb hack, etc.

To these kind of comments I will just answer that good naming prevail over modification of the build-in objects, and that these modifications add functionalities to them without removing/deleting/changing their original ECMA-262 definition.

Let's take one exemple.

Something as Array.prototype.indexOf is usefull for day to day programming tasks, it does not change the Array object behaviour and the naming is logic considering its action over an Array object.

The main concern of this library is to provide new functionalities in the logic of code reuse, but to provide just enougth and not too much, being heavyly focused on the role and use of the object itself.

With that goal, to add indexOf to the Array object is logic, to add quicksort is not logic.

Another goal was to use a lot polymorphism to keep the implementation of some behaviour simple, for exemple: copy, clone, toSource, etc.

Also in the logic of Once and only once and Don't repeat yourself the choice has been made to reuse core2 within itself, that's it all or nothing.

You can not use parts of core2, you have to use it all or don't use it at all.


Sign in to add a comment
Powered by Google Project Hosting