I was reading an article earlier when I cam across the following quote from Alan Kay:
"Lots of so called object oriented languages have setters and when you have an setter on an object you turned it back into a data structure."
The article went on to imply that this was not best practice and could hurt applications you develop in the long run.
I'm a CompSci student with experience with C, Java, PHP, Ruby etc... so am fairly familiar with OOP as a concept and a practice, but am by no means an expert.
I guess what my question boils down to is this:
Is it semantically correct (and a matter of best practice) when writing OO programs, to access field values (with getters) and then Create new Objects based upon the modified values RATHER than using setter methods to simply adjust the field of that object.
Or if have a piece of wood, and I then carve some wood off of that original piece, should I model that as the same piece with less mass, or a new piece entirely.
Using setters appears to be more concise and Garbage collection would be an issue if you were creating so many objects so I am approaching this question from a theoretical, rather than practical, viewpoint.
Thanks in advance for your answers!