in reply to Re: The fallacy of the *requirement* for read-only instance variables.
in thread The fallacy of the *requirement* for read-only instance variables.

Okay, but unless your program is going to run for the life of the dog, and the combined lives of all the dog 'registered', you are going to have store that unique id somewhere between runs of this program. And accessible to other programs that might need to deal with it. And that means that on subsequent runs you are going to have to read it back from some persistent storage and then set it.

Unless you can set it (at least once) it never has a value. And the only way to set it without using a setter, is to initialise it using a constant. Are you going to hard code all your unique ids into (all) your program(s)?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: The fallacy of the *requirement* for read-only instance variables.