Does this mean anyone else? I would prefer:
block.key(newKey); // set the key for this block
and
testKey = block.key(); // look up the key for this block
than
block.setKey(newKey); // set the key for this block
testKey = block.getKey(); // look up the key for this block
Firstly, "set" and "get" are redundant (and therefore add noise that reduces readability). The action (set / get) is determined by the syntax of each statement. I understand the overload. In fact, using the same exact identifier confirms that they are the same property of the object. When I read "getKey ()" and "setKey ()", maybe I'm not sure.
Secondly, if "get" and "set" should be strictly interpreted as setter and getter, then if other semantics related to setting / getting the value, for example, side effects, will be amazing.
, Smalltalk, , , "get" "set" , ? , , ?! ( )
- ?