Tuesday, April 6th, 2010blockquote>
DOM extension is one of the biggest mistakes Prototype.js has ever done.
The above quote comes from the infamous Kangax (of Prototype Core).
He kindly goes into graphic detail on why it is heinous, and how Prototype 2.0 will not follow this mistake.
Although it seemed great, in practice it didn’t work because of:
- Cross browser: host objects have no rules, IE DOM is a mess, etc
- Change of collisions
- Performance overhead
Extending DOM in controlled environment sure seems like a perfectly healthy thing to do. But even though the main problem is that with collisions, I would still advise to employ wrappers instead. It’s a safer way to move forward, and will save you from maintenance overhead in the future.
I look forward to seeing some examples of how usage of Prototype 2.0 would look. One of the things that I love about the Prototype library is the developer ergonomics. I personally much prefer
Lib.foo(element) even though they look similar. I look at a page of code and you see hundred of Lib.