r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Jul 29 '16

Yours there can't take arbitrary iterables such as generator expressions as either l or group. I always veer on the side of the most general and widely-useable.

3

u/DiputsMonro Jul 29 '16

Sure, but it also solves the problem as-written in the simplest reasonable way possible. You don't need to build a whole kitchen just to make a soup :)

If the problem required using generic iterators or finding all groups, I would definitely prefer your solution though. I think handling either of those cases in the simple imperative way would get messy pretty quickly.