Found the reason for the coin shortage.
It's totally wrong because you say functions shouldn't change values that aren't their return values. Functions can do whatever they are designed to do, which may be changing values that aren't their return values.Why is it? If a function changes variables on a global basis, that aren't passed as arguments or return values, then clearly that will make it harder to follow what the program is doing. Makes sense to me, even if I guess it would be hard to stick to that rule in all situations.
Possibly I'm out-of-date and that 'functional programming' style fell out of favour (for practical reasons?) but in what way is it "totally" wrong?
It's only a side effect if that wasn't the intention. If the intention is to change it inside the functions, then it's not a side effect. Those functions could very well be implemented "in the block" (scope) that still_alive was defined in. They could be implemented right below the code in the billboard.ideally functions shouldn't have side effects. if still_alive is going to get assigned to false, it should happen in the block that it was defined in, not in some other function.
That function is in your car too...And you nerds bitch when we start talking about cars for like 8 posts in here, lol.
Yeah, back to the funny pics, dammit!And you nerds bitch when we start talking about cars for like 8 posts in here, lol.