On Apr 23, 1:03 pm, Kannan Goundan <kan...@cakoose.com> wrote: > The code generated by protoc seems to go to great lengths to make sure > that once a message object is created, it can't be modified. I'm > guessing that this is to avoid cycles in the object graph, so that the > serialization routine doesn't have to detect cycles. Is this > correct? Would a cycle in the object graph put the current serializer > into an infinite loop?
I think it's more because our experience in Google is that immutable objects are easier to reason about - basically a lesson from functional programming. But yes, I suspect the side-benefit of preventing cycles is a generally good thing too :) Jon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---