Can you write a small example program demonstrating your problem?  I can
then debug it.

On Sun, May 3, 2009 at 8:33 AM, <> wrote:

> PS. is there a reason the compiler turns camelCaseFields into
> noncamelcasefields, but messageNamesAreStillPreservedWithCamelCase?

Historical reasons.  In the early days of protocol buffers, there was
disagreement about the style that field names should use.  The Google C++
style guide says that field names (and their accessors) should be
lowercase-with-underscores, whereas Java users prefer camelcase.  As a
result, we ended up with .proto files using both styles.  At some point
someone decided that the generated C++ code should force field names to
lower-case to match the C++ style guide, and someone else decided that the
Java code generator should force names to camelcase to match the Java style
guide.  Eventually, we ended up standardizing on lowercase-with-underscores
for field names in .proto files, as documented in the style guide: .  The
transformation of camelcase to lowercase in the C++ code generator had to
stay for compatibility reasons.

Class names, on the other hand, use camelcase in both C++ and Java at
Google.  So we don't transform those.

I recommend following the style guide for best results.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to