|
Boost : |
From: Joel de Guzman (joel_at_[hidden])
Date: 2006-07-05 10:01:55
Jeff Garland wrote:
> Don't get me wrong, I think the new range interface is a major usability
> advance -- well at least for unix programmers. He actually threw me off a bit
> with this example:
>
> std::string dst(...)
> range_copy(rng|to_upper|to_lower|to_upper, dst);
>
> which didn't make sense (apparently it was a joke). Still, I'm pretty sure in
> a code reading contest more programmers would understand this:
>
> dst.to_upper().to_lower().to_upper();
>
> as obviously ridiculous code.
Me, I prefer the immutable and functional approach:
to_upper(to_lower(to_upper(rng)))
Yeah, for the record, I never liked the use of the |. With the
plain functional syntax, the joke is very clear.
For the record, I don't like fat everything-but-the-kitchen-sink
interface too. Same as I dislike mutating functions. Sorry, Jeff.
Regards,
-- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk