I work as a staff software engineer at a med tec company. We are mainly programming in C++ but my background is also a functional one (Haskell, OCaml).
In the past I did research in program analysis.
A getter is only really necessary to guarantee an invariant on the internal field.
If there is no invariant for the internal field, then it is not necessary to write a getter.
If one assumes that there might be an invariant that is to be added later, then it might be better to start with a getter. Otherwise, it doesn't matter.
Furthermore, getters are for accessing the state of an instance. If you need to sort or get a representation, create a method for that. There often exists a convention in the languages (e.g. compareTo or operator==).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A getter is only really necessary to guarantee an invariant on the internal field.
If there is no invariant for the internal field, then it is not necessary to write a getter.
If one assumes that there might be an invariant that is to be added later, then it might be better to start with a getter. Otherwise, it doesn't matter.
Furthermore, getters are for accessing the state of an instance. If you need to sort or get a representation, create a method for that. There often exists a convention in the languages (e.g. compareTo or operator==).