[Rprotobuf-yada] c++ class names

Dirk Eddelbuettel edd at debian.org
Sat Dec 5 16:43:32 CET 2009


On 5 December 2009 at 08:31, Romain François wrote:
| Hello,
| 
| I am getting annoyed by the "protobuf" prefix we have for the S4 classes 
| that shadow some C++ classes:
| 
| protobufDescriptor
| protobufFieldDescriptor
| protobufEnumDescriptor
| protobufServiceDescriptor
| protobufMethodDescriptor
| protobufFileDescriptor
| protobufMessage
| 
| and was thinking maybe we can remove the prefix before we release the 
| first version.

I'd rather go the other way -- something I meant to bring up was that 

    using namespace google::protobuf::compiler ;
    using namespace google::protobuf ;

is considered uncool as it is 'too global' and against the spirit of
namespaces.  OTOH it is really, really long -- but one can do tricks such as
namespace aliases:

    namespace gpc = google::protobuf::compiler;
    namespace gp  = google::protobuf;

which, instead of requiring (without the using namespace ...)

    google::protobuf::compiler::Foo f;

allows a much simpler

    gpc::Foo f;

Of course, we could also use GPC or GooPrCo or ...  

What do you think?  


As for your question above, I hear you. But I am too much of a noob with S4
to be really comfortable.  To me, this is safe and explicit. Dunno.

Dirk

-- 
Three out of two people have difficulties with fractions.


More information about the Rprotobuf-yada mailing list