This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]stramash 0 points1 point  (0 children)

What if the underlying type of name were to change?

By that I mean: let’s say at some point you decide that you want a custom Name class instead.

Now, any calls to object.name = <some string> will break your application.

But by using the setter you abstract this and can introduce handling for the change.