Is child order dependable?

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

Hi all. I’m teaching myself about programming. I’m trying to anticipate problems before they occur. If I call Object.get_children(), can I depend on that array looking the same to the computer across all platforms? Coming from Python, I know not all data structures have fixed order - dictionaries only got it fairly recently, for example, and I’m still not sure if their order is “dependable,” (OS quirks mess with it IIRC).
I ask this not because I am experiencing a bug related to the issue, but since I don’t want to make false assumptions about how order is maintained. If the question is too vague to understand, please let me know and I will attempt to revise, but my technical skills are still underdeveloped, so my descriptions may fail me.

very nice and informative for me.

theoMCI | 2020-03-19 15:44

For the record, Godot’s Dictionary class preserves order since 3.0, even though it may not be apparent when printing them.

Calinou | 2020-03-24 15:05

:bust_in_silhouette: Reply From: kidscancode

Yes, child order is fixed, and get_children() returns an array of the children in order. See also get_child() and get_position_in_parent().