On Saturday, March 5, 2016 12:00 PM, Robert Ramey
wrote: On 3/5/16 8:25 AM, Paul Fultz II wrote:
Shortening the name creates confusion, makes code less readable. Since most of the library is defined inside the namespace, it doesn't really add any typing. In those cases where the typing does get long, one can at a (local) alias.
However, you can't namespace alias a macro though.
Hmmm - you can't? Cant you just use
#define MY_SHORTNAME RIDICUOUSLY_LONG_NAME
and use
MYSHORTNAME(X) in place of RIDICUOUSLY_LONG_NAME(X)
You have to do that for every macro. Plus, I would prefer a short name so the user doesn't have to write code when they want to use the library.
I seem to recall this working. Even if you can't, I'd say the benefit
of an abbreviation isn't worth the confusion it causes.
Especially, since a lot of functions are composable a long name such as boost::function_utilities make it unbearable. It is commons for a lot of libraries to shorten the name such Boost.Asio, Boost.MPL, Boost.MSM, Boost.GIL, Boost.ICL, and Boost.MPI. I would prefer an abbreviated name, such as: - Boost.Fn - Boost.FU - Boost.FL