Timeline for answer to Should I write out computed vars that all depend on one other var, or should I assign them as normal vars in that single var's setter? by Kilian Foth
Current License: CC BY-SA 3.0
Post Revisions
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 11, 2017 at 17:28 | vote | accept | Kevin | ||
| Dec 11, 2017 at 15:27 | comment | added | mmmmmm | @Kevin also look at lazy properties they are calculated once and can be read many times but if the underlying changes? | |
| Dec 8, 2017 at 15:38 | comment | added | Kevin |
Writing them in the getters of the vars would mean running the formula every time the var is accessed, while putting it in bar's setter means running the formula only if bar changes, right? Ooooh I think you just opened my eyes, I just need to figure out what happens more often, changes in bar or reads of the other vars, and decide based on that result.
|
|
| Dec 8, 2017 at 15:06 | history | answered | Kilian Foth | CC BY-SA 3.0 |