On Thu, Oct 8, 2015 at 9:33 AM, Anna Shi <c...@google.com> wrote:

> Hello,
>
> I am wondering is there any coding guidance on recursively defined
> protocol buffer message within Google?
> I am thinking of defining adding a new field in an existing protocol
> buffer message like the following, but not sure if there is forbidden or
> frown on by Google coding style. Any advice will be appreciated.
>
I don't think there is a problem with it. It's neither recommended, nor
discouraged.

There is one catch though: you can't nest the messages too deeply, or else
parsing such messages will simply fail. The default recursive limit in C++
is 100. It varies in other languages.


>
> message Foo {
> ...
>   optional Foo sub_foo = N;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to