4 ms·
My favorite anti-example is year based tax calculation. Rules can change enough from year to year so that parameters isn't enough. You will end up with code s
by silvestrov 2y ago
My favorite anti-example is year based tax calculation.
Rules can change enough from year to year so that parameters isn't enough. You will end up with code specific for each year.
You don't want to introduce any chance of changing results for old years when changing common code.
So best to have no common calc code. Each year is fully set in stone.
- TheCoelacanth 2y agoI don't really agree with that example because of bugs. The rules for how to calculate taxes for a past year don't change, but you probably didn't implement the previous year's rules perfectly. If you discover a mistake in how you calculated taxes for a previous year, you should recalculate them so that you can file an amendment.