What's The Benefit Of Using Extend.js?
Solution 1:
I suspect a sensible answer to this question leans heavily on a generic answer for any third party tool.
People use third party tools when it helps them get the job done faster and more elegantly, at least that's the theory. But there are people, myself included who find it more elegant to reduce dependencies and to implement from scratch. To us there is little value in including sugar in our projects, because this devalues our principles.
To others it has values because it reduces the amount of code they have to write and perhaps feels slightly more structured. They would have made the same abstraction themselves, so it makes sense to use a well thought out and tested library.
It weights heavily on your personal preferences and usage. Admittedly I have not addressed the usage of this library in particular, it is only 51 lines of code. It shouldn't take long to read over the features it's providing and to come to your own conclusions.
From what I can tell this library merely creates namespace hierarchies and checks for conflicting namespaces. Most of the code seems to be focused of creating the hierarchy and verifying namespace distinctness. This would suggest to me it's been designed as a general purpose tool in situations where conflicts might occur - say you are publishing your own library for mass consuption.
If you want my opinion though, it would be from a person who wouldn't use it by choice. Namespaces are actually unnecessary. All that effort to prevent multiple namespace conflicts on window does sound necessary if you are actually concerned about conflicting namespaces, but any good design never would be.
Post a Comment for "What's The Benefit Of Using Extend.js?"