Boost logo

Boost :

From: Greer, Joe (jgreer_at_[hidden])
Date: 2006-10-13 09:01:42


> On Behalf Of Martin Adrian
>
> Why is
>
> boost::super_string ss(s)
> ss.trim()
>
> easier than
>
> boost::trim(s)
>

Well, because boost::trim(s) isn't "object oriented". It's procedural
and if I am looking up operations to do on a string via the string's
documentation, I won't see an external function named trim. This makes
it very difficult for people to find out what the available operations
are.

This is very different than basic or other procedural languages in that
procedural languages make an effort to group related functions in their
documentation whereas oo languages do not. For better or worse, C++ is
documented as a OO language and not as a procedural language.
Furthermore, if we were to say the strings should be manipulated via
functions, then we need to yank methods out of the string class so that
we don't have a multiple personality disorder going on. AFAICT, the
current situation buys us nothing good and cause people to seek a more
rational language.

I use this language every day, but I have to say that there is a certain
love/hate relationship with it. There is just so much you just have to
*know* with no consistent way of finding it if you don't. Google is
really your friend in many cases.

Anyway, my point is that it is a huge documentation difference when it
comes to being able to see what is available to be done to a string. I
have seen a few attempts to treat string specially in the documentation
and lump things together. However, this is generally inconsistent with
all the other objects and for no better reason than C++ has a lame
string class.

Just my opinion and experience,
joe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk