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

Written by

I’m senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store