At 04:37 AM 7/7/2003, Russell Hind wrote:

>I'm not saying replace all the XXXX_string methods with a str() but
>jshould we have
>
>str()
>native_file_str()
>to_simple_str()
>
>or
>
>string()
>native_file_string()
>to_simple_string()
>
>just to commonise things.
>
>Filesystem has a string() method.  stringstreams use str().  I also
>agree that boost libraries don't need a c_str() method since this can
>come from the string() (or str()) method.

There are obvious advantages to common naming conventions.

But "str" vs "string" isn't as clear-cut as it would be if we were starting with an empty page.

"string" is better because it is more explicit and less prone to misunderstanding. But many existing libraries (boost and non-boost) use "str". Actually, that's one of the problems with "str". It is not uncommon to see it used for functions which return char*'s, std::strings, or homebrewed types, and that's confusing. That was part of my rationale for chosing "string" as the name in the filesystem library.

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to