Is there really any good reason for code-gen? Just because “google did it” doesn’t mean it’s a good idea.
There are definitely some downsides to the approach though, mostly typical problems you would expect with machine generated code. Namely that it’s verbose and if you have a super complex protobuf data model (hundreds or thousands of fields) and want to ship a fatjar or similar bundling of dependencies you can run into some size issues.
Plus, Any [1] is an effort to standardize the ability to carry the proto type (as a global identifier that can be used to retrieve its schema) alongside its serialized format.
[1] - https://developers.google.com/protocol-buffers/docs/proto3#a...