Professionalism, Craftsmanship, Discipline
I’m using the terms “class” and “data structure” in an abstract sense here, indicating their purpose rather than the language feature that implements them. Data structures, in C# at least, can be implemented using either classes or structs. “Classes” in the abstract sense are more directly relatable to C# classes.
Ask, don’t tell
Data structures carry data and little or no logic. You ask a data structure to give you data, you don’t tell it to do something.
Data Structures have…
- Public Getters.
- Sometimes Public Setters.
- Few (if any) methods.
- No public methods.
Particularly in these days of multi-threading I make data structures immutable unless there’s a good reason no to.