Re: [whatwg] Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

> (I've used querySelector exclusively for quite some time, and I find
> arguments that querySelector isn't readable or "the wrong tool" to simply
> not hold up.  I find it more readable, actually, since I don't have to
> change interfaces depending on whether I'm searching for an ID or a class.)
>

I think you just described the anti-pattern of readable code: a function
that does more than one thing. Wrong/right tool, depends on the use case.
Often times a Swiss knife will do the job of simply driving a screw.
However, a screwdriver will be more suitable for screwing a lot of screws,
and moreover when you see a screwdriver you know what it's going to be used
for as opposed to for a Swiss knife it's hard to tell. Then again, if you
don't know what's going to be thrown at you and you need to pack lightly,
nothing as handy as a Swiss knife.

Cheers,
Jussi


>
> --
> Glenn Maynard
>
>

Received on Wednesday, 3 July 2013 17:16:32 UTC