Posted 27 August 2014 - 06:27 PM
That said... I'd prefer the negative value. This moves any special logic about increase vs decrease into that one single function rather than making every single call of the function have to make the differentiation. It also makes it easier to have various game systems that don't actually know if they're going to raise or lower a stat but rather just evaluate some math and pass that along. e.g., then you only need a single ModifyStatEffect that has an integer and stat ID rather than needing both an IncreaseStatEffect and a DecreaseStatEffect (or a more complicated ModifyStatEffect).
Localize your logic as much as possible, don't force people to repeat themselves. With the separate functions, many callers are just going to have to cut-n-paste this code:
int mod = calculate_modification();
if (mod < 0)
else if (mod > 0)
and that's not good.
It might be questioned, sure, but there are a bazillion terrible programmers out there with fancy titles in charge of projects who will want to impose their ways onto everyone. Don't worry about whether something will be questioned in a corporate environment. For learning, worry about whether it's good not, and then realize that once you work at a company you may have to adjust a little to "fit in" with whatever practices are in place, good or bad.