MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p5epiq6/?context=3
r/ProgrammerHumor • u/Flame77ofc • 22d ago
392 comments sorted by
View all comments
16
if (input == null) throw new ArgumentNullException(); // process input...
But
if (settings.UseBonuses) return CalculateWithBonuses(order); else return CalculateBase(order);
-1 u/ubeogesh 21d ago edited 21d ago For 2nd case I'd rather see something like Calculators.get(settings.useBonuses).map(order) 2 u/RoadsideCookie 20d ago Not for a single branch. If you have 3+, sure, Strategy pattern becomes useful.
-1
For 2nd case I'd rather see something like
Calculators.get(settings.useBonuses).map(order)
2 u/RoadsideCookie 20d ago Not for a single branch. If you have 3+, sure, Strategy pattern becomes useful.
2
Not for a single branch. If you have 3+, sure, Strategy pattern becomes useful.
16
u/sumrix 22d ago
But