You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On typing primitives, my experience: leave dynamic values untyped, static values (ie enums) typed.
I used to type strings like api.VolumeID the same way, but my experience has been that it just gets in the way and doesn't add any protection. Engs still end up casting whenever something doesn't work, and generally its just a bunch of annoying casting.
For enums, using strings (as I mention in #71) leads to insonsistent usage, as some engs will just use the freeform value, even though another eng might look at the list of values and think this is all that is used. We already see this with Filesystem - btrfs is used as a Filesystem, but is not defined. There were more to on the branch proto: https://github.com/libopenstorage/openstorage/blob/proto/api/api.proto#L11
Thoughts?
The text was updated successfully, but these errors were encountered:
On typing primitives, my experience: leave dynamic values untyped, static values (ie enums) typed.
I used to type strings like api.VolumeID the same way, but my experience has been that it just gets in the way and doesn't add any protection. Engs still end up casting whenever something doesn't work, and generally its just a bunch of annoying casting.
For enums, using strings (as I mention in #71) leads to insonsistent usage, as some engs will just use the freeform value, even though another eng might look at the list of values and think this is all that is used. We already see this with Filesystem - btrfs is used as a Filesystem, but is not defined. There were more to on the branch proto: https://github.com/libopenstorage/openstorage/blob/proto/api/api.proto#L11
Thoughts?
The text was updated successfully, but these errors were encountered: