3 ms·
> In every single case where you might want a repeated oneof, you always want to wrap it in a message (product type), and then repeat that. That's exactly what
by Dylan16807 8y ago
> In every single case where you might want a repeated oneof, you always want to wrap it in a message (product type), and then repeat that. That's exactly what you can do with the existing design.
But I could use the same argument for repeated anything. Why even allow repeated primitives at all, if your argument is convincing?
- fixermark 8y agoThere is a protobuffer best practice that suggests that if you think you might need a repeated message in the future, you should use a repeated message instead of a repeated primitive conservatively.
- kentonv 8y agoRepeated primitives were in the first version, before anyone knew better. I'd argue against them in new code. In Cap'n Proto, I made it possible to upgrade a repeated primitive to a repeated strict whose first field is the primitive type, to avoid this trap.