Timeline for What's the alternative to DRY code when it requires too many parameters?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 1, 2015 at 16:59 | comment | added | CR Drost | @RobertHarvey I mean, Haskell does it type-safely; whether their language will allow them to do likewise depends on their language, no? And yes: sometimes it is more DRY to store parameters in a data structure rather than to pass them directly, especially if those data structures come at the end of a design period after the system has been beat-up a bit. The main cost is that you need a central place to document the data structure when new options are added, but that's already a problem whenever the system has gotten this complex. | |
Oct 1, 2015 at 16:52 | comment | added | Robert Harvey | So you're advocating subverting the whole parameter passing/type checking process by passing around dictionaries instead? | |
Oct 1, 2015 at 16:34 | review | First posts | |||
Oct 1, 2015 at 19:12 | |||||
Oct 1, 2015 at 16:32 | history | answered | CR Drost | CC BY-SA 3.0 |