1 min readAug 25, 2020
syntactically they are the same
But naming is important:
1) setColor gives the idea of the object being undefined ot *not set* at some point in time
2 setColor can be identified as a setter so the reader might think you are assigning the color to the argument you are sending. this violating information hiding.
changeColor: on the other hand is implementation agnostic, so you can store your color in a completely different format (for example hexadecimal) by translating your argument
Name is much less coupled