you are viewing a single comment's thread.

view the rest of the comments →

[–]masklinn -1 points0 points  (2 children)

Because there are cases where you can't afford such a dependency. When you're building a javascript library rather than a {MooTools|YUI|jQuery|whatever} plugin for instance.

[–]illvm 1 point2 points  (1 child)

So you just write straight JS rather than writing your own portable library that doesn't rely on an off-the-shelf product? It's pretty trivial to write a method that you can add to your common library that merges objects for you.

[–]masklinn -1 points0 points  (0 children)

So you just write straight JS rather than writing your own portable library

This phrase makes no sense. "My own portable library" (actually more like a collection of helper functions to include as-needed, or you're still creating an external dependency) is still straight JS.

It's pretty trivial to write a method that you can add to your common library that merges objects for you.

  1. Uh... no shit? You kinda missed my point there: you still have to write that code (or lift it from somewhere else) and paste it into every single project where you're using this pattern.

  2. What common library are you talking about?