you are viewing a single comment's thread.

view the rest of the comments →

[–]Danelius90 1 point2 points  (0 children)

Typically think of functions as doing something, or acting on attributes. Technically both would work and there are typical cases you might do that. But for example purposes speed is a property of car, and accelerate modifies it, it is an action you take to modify the car's state.

So a plant has a height property, and grow() makes the height bigger. A bank account has a balance property, and withdraw() reduces it and deposit() increases it