Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

I too enjoy defining my default attribute values at the protocol level, so they can never, ever be changed, and then defensively coding library functions in case the arguments are not constructed under the same semantic assumptions as I had years ago.

Also everything needs to be marked optional or you'll need to restart the whole service mesh to change the schema.



Default values in proto are considered an anti pattern and was removed from the language in proto3.

Agreed that protocol level required is bad, and it's with proto3 made optional the default.

Our team enforces required fields via proto annotations, which can be much more flexible (we have transitional states to be able to upgrade or downgrade the check)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: