Dave Thomas <br />Author of "<a href="http://www.amazon.com/exec/obidos/ASIN/020161622X/ref=ase_electricporkchop/002-7467239-7061602" target="_blank" rel="nofollow">The Pragmatic Programmer: From Journeyman to Master</a>
Originally posted by Dave Thomas:
If you used accessors, then you could have two of them: the old getAxisPosition that returned an int still (presumably rounding intelligently). Then you write the new interface, getAxisPositionFloat (gotta love the fact that you can't overload based on return type, eh), and you can gradulally switch your code over to using it.
Dave
Mark Herschberg, author of The Career Toolkit
https://www.thecareertoolkitbook.com/
It seems what I need to consider more when designing the class is "Why does the client need this information?" and "How will they use it?" as opposed to being so focused on actual data types.
For my next trick, I'll need the help of a tiny ad ...
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|