Documenting elements of a struct

I cannot agree with this. Fields are considered by many (me too) to be internal implementation details. If they are documented as part of the interface, that means changes to fields are breaking and require updating major version. Fixing bugs or reorganizing implementations risks breaking other people’s code, completely unnecessarily.

Imho, field names should be possible to change without notice. For those who want fields as part of the API, by all means document them, but this should not be a general requirement.

1 Like