Neither of your requirements are true in the least. It’s a great idea because he’s penalizing himself for failed builds in a really fun way, with no waste because it’s going to a good purpose. It’s called “win-win” and it’s a good thing.
OP and yourself are perhaps engaging in what could be termed as "semantic trolling"
Fortunately it isn't working because as others pointed out, "penalize himself" and "donate to charity" concepts aren't directly tied together. Where the donation actually goes is immaterial, so it's not possible to argue that "punish himself" implies "donate to charity" is punishment.
But surely 'losing money' to a bad cause would be an even better punishment. Is the punishment supposed to discourage breaking builds? Are the 'warm fuzzy feelings' (or the actual benefits of the relevant charity!) that causing a charitable donation to occur being properly accounted for in deciding whether this is a good idea?
Punishing himself is the losing money aspect. It doesn't matter where it goes technically for it to be a punishment. His goal is to not lose money.
But to make it worthwhile (aka the reward part of the punishment), the donations are directed to charity since they need to go somewhere. So that's a small reward built into the punishment.
It's better than just throwing away money after a failed build. But a true win-win strategy is donating to charity unconditionally, and not wasting time punishing yourself for failed builds in an elaborate way ;).
You are advocating perfection while op is making the best out of the dealt cards. We need both approaches as a society, but one should not nag the other.
In reality I was just nitpicking. Doing the win-win strategy I described does require more willpower, and I understand that one employs tricks like these to avoid using willpower.
Incidentally, I somewhat envy people who are capable to pull such strategy off. It requires some amount of suspension of disbelief, forgetting for a moment that you're the game master and playing the game by the book way past the point it's become uncomfortable. I don't have that. I tried many times, but my mind just refuses to participate in self-trickery.
> penalizing himself for failed builds in a really fun way
That doesn't make sense. Penalties aren't fun. Building software isn't a game (generally).
And there sure seems like there's a real possibility of wasteful behavior, e.g. someone 'spamming' the build system to effect a large overall donation.