Should I use set/get or the member directly?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By char0xff

A lot of the engine class members have set/get methods. Should I use those or can I just directly use the member variable?
An example is “owner”.
Should I do:



owner = parent


I suppose it’s the same and the user can choose what fits him better, but I like to follow guidelines/rules, and there doesn’t seem to be anything in the docs about this.
There is GDScript Style Guide — Godot Engine (3.0) documentation in English , but nothing about this issue.

:bust_in_silhouette: Reply From: kidscancode

Using the member variable is preferred. Note that the autosuggest as you type will only suggest members, not set/get functions.

I will update the styleguide to reflect this.