Timeline for Callbacks: when to return value, and when to modify parameter?
Current License: CC BY-SA 3.0
2 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 3, 2014 at 17:50 | comment | added | JDB | In the end, "personal preference" wins just about any discussion about programming techniques since there are few objective ways to analyze practices. I will say, though, that copying values from a returned object can be a bit more expensive... you have to do that additional processing, plus if you ever add a property you have to make sure to update the code which processes the callback value. | |
| Jun 3, 2014 at 16:38 | history | answered | Ant | CC BY-SA 3.0 |