Timeline for Is it better to have separate functions or add more arguments to a function?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 30, 2014 at 9:01 | comment | added | Konrad Morawski | Every option has its pros and cons. I made it into an answer of my own. | |
| Sep 30, 2014 at 8:43 | comment | added | user3154108 | This is true, which is why I'd make the shortcuts obligaory by making the core function privat in whatever way my language may offer or convention at least. | |
| Sep 30, 2014 at 8:34 | comment | added | Konrad Morawski | It invites inconsistency, though. One programmer will be using setVoltage(1, 220), perhaps unaware of the shortcut, another will prefer the shortcut setChannelOneVoltage(220). Third programmer comes over, searches for all usages of setChannelOneVoltage (for some reason) and it may not occur to him that he's overlooking setVoltage(0 calls. Is it a dealbreaker? No, but it should be taken into account. Every optional shortcut will be used inconsistently and therefore add a bit of noise. | |
| Sep 30, 2014 at 8:23 | review | First posts | |||
| Sep 30, 2014 at 10:19 | |||||
| Sep 30, 2014 at 8:23 | history | answered | user3154108 | CC BY-SA 3.0 |