Yeah, good example. Indeed, I'd often have something like
const int something_size = 16; const int something_else_size = something_size;
so that everything uses the appropriate variable now, and if they diverge in future it's easy to change one of them and not need to separate out which uses need to change.
And conversely, if other parts of code start to depend on them being the same, it's easy to search-and-replace and make them all the same variable, if we decide we want to give up that functionality to avoid doing extra work to keep it true.
no subject
Date: 2018-09-25 03:09 pm (UTC)so that everything uses the appropriate variable now, and if they diverge in future it's easy to change one of them and not need to separate out which uses need to change.
And conversely, if other parts of code start to depend on them being the same, it's easy to search-and-replace and make them all the same variable, if we decide we want to give up that functionality to avoid doing extra work to keep it true.