✅ Readonly methods
My VSCode is telling me to change my methods to readonly. I can't find a good explanation anywhere as to what this does and why it's recommended. So I'd really like an explanation from someone who knows.
5 Replies
readonly
methods in structs basically say that the method does not modify the state of the structBut it does right..? My methods modify my Entries property.
It modifies the contents of this list
It doesn't modify the state of the struct
That is, it doesn't do
entries = new List<Entry>()
for example
Also, it's not a property, it's a fieldoooo okay
$close
If you have no further questions, please use /close to mark the forum thread as answered