
| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Reece Dunn | Sent: 18 February 2004 17:23 | To: boost@lists.boost.org | Subject: RE: [boost] Re: algorithms namespace | | | Stefan Slapeta wrote: | >Pavol Droba wrote: | > | >>It is not really reasonable to await from | >> a user to always type boost::algorithm::string::trim. | >> | > | >Maybe it could help a little bit to replace 'algorithm' by 'algo' and | >'string' by 'str'. | > | >IMHO, also shorter namespaces like 'boost::filesystem' have | the problem | >of | >beeing too long to be used on every access. Long typenames like | >boost::filesystem::directory_iterator have a very high | capability to make | >the code unreadable very quickly. | | why not use: | namespace sa = boost::algorithm::string; | sa::trim( ... ); | or | namespace fs = boost::filesystem; | fs::directory_iterator di = ...; | | Surely this gives you what you are after (shorter namespace | names) without | modifying the namespace currently used by the library (which | will break | existing code that uses the libraries). | | This is what namespace aliases are for and is used for the filesystem | library in the regression test implementation. | | Regards, | Reece Definitely, and also one can (and often should) write using boost::algorithm::string::trim; // etc using boost::filesystem::iterator; // Perhaps locally, if a more 'global' declaration might cause ambiguity problems. So I strongly oppose the use of abbreviated names. One of Boost's strengths is the refusal to use incomprehensible abbreviations. (Spare a thought too for what may be the majority of users - those whose first language is not english. Abbreviations won't appear in the dictionary.) Paul Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539 561830 +44 7714 330204 mailto: pbristow@hetp.u-net.com