Semantics are definitely important, but it's also good if technically your code follows your intentions. I definitely used const members in a way where they were semantically correct, but I didn't consider the technical implications.
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.
In my opinion, when you create a class
Foo, there is a broader question than "should memberbarbeconstor more?".This broader question = "is
Fooa value object or not?"If
Foois in fact3DCoordinate, thenFooshould be copyable and its members datax, `yandzshould not beconst.If
FooisBankAccount, then it should be impossible to copy an object and its members datanumberandownershould beconst.For me, the question "
constor not?' has to be answered based on semantic first, not on "technical details" :)Semantics are definitely important, but it's also good if technically your code follows your intentions. I definitely used const members in a way where they were semantically correct, but I didn't consider the technical implications.