3 ms·
Especially if there is a very common refactoring bug and you get a pepperoni pizza instead of a pizza with one of the most natural toppings like pineapple. But
by raxxorraxor 4y ago
Especially if there is a very common refactoring bug and you get a pepperoni pizza instead of a pizza with one of the most natural toppings like pineapple.
But I tend to agree with the author. Sometimes verbosity is the lesser evil. No suggestion should become a dogma and whoever played some games of code golf knows that short code doesn't mean code that is easy to read. Extreme example of course. But I believe many start to optimize in this way just as a way to reduce the line count.
Still, there is still room for some kind of factories or function templates (not in the c++ sense). I think a user is allowed to repeat himself but then again a user is just another arbitrary layer again. But if such helpers are to be implemented, I tend to like it in a place where the user is invoking said helpers and not on the level below that if that makes sense.
- ajuc 4y agoMy favorite pizza is pepperoni with pineapple and red beans.
- deleted 4y ago[deleted]
- zoomablemind 4y ago> ...Especially if there is a very common refactoring bug and you get a pepperoni pizza instead of a pizza with one of the most natural toppings like pineapple. Exactly! The DRY'ed example in the first section should read rather: def make_hawaiian_pizza(): make_pizza(["ham","pineapple"]) This demonstrates the omnipresent dangers of untested copy-paste. "Copy-paste, copy-paste, Will Robinson!!"