I'm using Swift, but I understand computed properties are a thing in a few other languages as well. I have the following case:
Foois changed throughout program flow.
dare constrained to
bar's value so defining them as computed properties is a clean way to handle that.
- the constraints are simple calculations that take
barand output a value
I can write the formula in the getter of each of the individual vars (the formulas vary slightly), or I could have the vars be normal properties and just assign them in
Which is more preferable? Is there anything more to consider than style?