[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#802595: ITP: node-defined -- return the first argument that is `!== undefined`



Josh Triplett wrote:
>Steve McIntyre wrote:
>> 
>> YA tiny Javascript "library" containing 3 lines of utterly trivial
>> code. :-(
>> 
>> I appreciate you're just following through a dependency chain from
>> upstream for tape, but please push back on upstream and ask them why
>> they're doing this kind of ridiculous split-up. Code re-use in general
>> is a good plan, but not at the level of every trivial helper function
>> being split out into its own library!
>
>"why" is because node (and other modern languages) make it easy to
>create a package for any particular bit of reusable code.  That Debian
>fails to support that is Debian's problem, not upstream's.

In the general case I might agree, but have you actually looked at
some of these cases? It's ridiculous in any language to have a
separate library for a single function as trivial as:

    for (var i = 0; i < arguments.length; i++) {
        if (arguments[i] !== undefined) return arguments[i];
    }

Split it out into a separate helper function in the surrounding code?
Sure. Add it to your own library with lots of other little helpers?
Yes, by all means if you're using it a lot. But a separate library
with its own docs and test suite and everything? No, that's a joke.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"Further comment on how I feel about IBM will appear once I've worked out
 whether they're being malicious or incompetent. Capital letters are forecast."
 Matthew Garrett, http://www.livejournal.com/users/mjg59/30675.html


Reply to: