Hacker News new | ask | show | jobs
by pheroden 3835 days ago
It was very divided 4-5 years ago, predominantly when underscore and jQuery were both champing at the bit to be the top utility library. It's shifted towards not monkey patching, but it's not not absolutely decided for many developers.
1 comments

It was very undivided 8 years ago - it was common knowledge to never, ever override the prototypes of built-in objects. In fact, a major reason that JQuery won out over Prototype & Mootools was because the latter two monkey-patched built-in prototypes, and as a result were incompatible with each other or with any other library that overrode built-in methods.

IIRC, this was an interview question at Google when I applied in 2008, and I think one of the reasons I got the job was because I was aware of all of the pitfalls of it.

I managed to skip using underscore, but from a quick glance through the library, isn't the reason it's called underscore because it provides '_' as a namespace for all the utility functions, rather than altering Array.prototype the way Prototype did?

I read the underscore source code a few years ago. My memory may be failing me, but I don't think it altered any builtins.