3 ms·
Are struct tags meant to be similar to Java Attributes and C# Annotations? Seems like a fine pattern but needs more tooling.
by jayd16 7y ago
Are struct tags meant to be similar to Java Attributes and C# Annotations? Seems like a fine pattern but needs more tooling.
- SamWhited 7y agoI don't know about Java or C#, but it's a key-value pair on a struct field that you can get back with reflection.
- azth 7y agoThey're much weaker than annotations and attributes. You can amend the type system with annotations (e.g. nullability detection, as well as compile time validation - check out micronaut to see an example of what they're doing with annotations).