Re:Is_computer_on_fire() (2000)
by mnx on Sunday December 21, 2014 @04:26PM
(#8781033)
Some languages provide you with a mechanism to deal with that (c#s properties), and many others allow you to get a similar result with function overloading. So you don't have getX() and setX(), you have X(), and X(int x)
[ Parent
| on HN ]
While function overloading is a neat trick, I think it's a step backwards in terms of code readability.
In those instances, it's only clear from the usage rather than the name how that function behaves, so I think I'd rather see getX and setX over X() and X(int x) and be absolutely clear about the role of that function.