From: Paul A Bristow (pbristow_at_[hidden])
Date: 2007-05-24 09:09:53
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Jake Voytko
>Sent: 24 May 2007 03:37
>Subject: Re: [boost] GSoC project "Visualization of
>STLContainers as SVG" -setting options using << or
>Overall, I'm not against letting users use method calls to set
>parameters of classes.. sometimes, that's what they're there for.
>However, I don't feel that this is an alternative that is intuitive to
>users. When a user normally does chaining, like
>my_vector.to_string().find(...), they aren't expecting my_vector
>to be affected. However, show a beginner the longest cout statement
>you can think of with as much chaining as you want and they'll
>understand that it all affects the printout, even if they don't know
>what a stream is! I feel that the stream operator chaining can
>immediately be grasped by beginners, as they know that since it looks
>like cout and file streams, it must affect a file somehow.
I'm surprised by this view of beginners expectations.
Using a set function is surely very common.
Although chaining is less common,
you don't have to chain, you can write:
whose meaning is surely quite obvious?
but once you see an example of chaining, I feel it is obvious what to do to save a bit of typing - always popular!
Other peoples views on this?
PS Your prototype code doesn't permit chaining freely - it would intolerable in real-life use. But I'm sure you will be working on
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk