4 ms·
This is true for proto3, but not for proto2 (except for repeated fields, which are always non-null but can contain 0 items). Proto2 has `HasFoo` methods, which
by joshuamorton 4y ago
This is true for proto3, but not for proto2 (except for repeated fields, which are always non-null but can contain 0 items).
Proto2 has `HasFoo` methods, which distinguish between empty (unset/null) and set explicitly to zero fields.
I don't like that proto3 made this choice, I think it was wrong, but there was some rationale behind it beyond just "elegance".
- somenameforme 4y agoCan you elaborate on the reasons for the decision? I've always been quite curious on the reasoning there.