Timeline for What is the benefit of a function without parameters which only calls another function
Current License: CC BY-SA 3.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 4, 2014 at 21:17 | comment | added | Warbo |
@Aaronaught It's true that I'm against OOP, but I certainly wouldn't recommend setFoo calls, since that implies mutable data. Altering the contents of variables/properties is an effect, which causes all calculations using that data to become impure. I wouldn't recommend execute calls per se, but I would recommend runFoo procedures for executing actions based on their arguments.
|
|
| Oct 4, 2014 at 3:26 | comment | added | Aaronaught | You seem to be advocating against OOP here, where the fundamental principle is "tell, don't ask". Following the advice here is what normally leads to code riddled with useless "getFoo", "setFoo" and "execute" calls. OOP is about combining data and behavior, not separating them. | |
| Oct 2, 2014 at 23:10 | history | answered | Warbo | CC BY-SA 3.0 |