I think this question can span multiple languages, but in C# specifically there is a clear distinction between a field (ex: private int a;
) and a property (ex: private int b { get; set; }
). While there is often good reason to choose one or the other, in many cases they can be used interchangeably and they serve the same purpose and choosing between them is just a matter of convention.
Is there an umbrella term that includes both of these distinct concepts? Something that means "property or field" without having to say "property or field"? The word "variable" could potentially work but that also includes function-scoped variables and I'm not even sure if it technically includes properties.
I want a word I can use when a value should be stored in a class-scoped data construct but it doesn't matter if it's a field or a property.