Order of Method and SubClass

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

In Godot Script introduction we have been shown the order of how our scripts supposed to looks like (i.e Class Name-Inheritance, Public method-private method) however there’s something specific I want to know like how I supposed to order my particular Script Section.

Let say I have these private Method

func _get_leftover_apples_to_eat() #1 func _remove_apple(apples, number) #2 func _select_apple_to_eat(apples, condition) #3

By letter that how it’s ordered, however method #1 is implemented with method #3 so it would be convenient to place them next to other, it would be easier to interpreted it without too much scrooling, I also heard in most OOP based programming it was a good practice, but that would make it harder to search particular function since it is not ordered alphabetically(assume I have hundreds of functions and I just remember its partial name), so how I suppose to order it? by letter or relevancy? and how about SubClass? where should I place it?

I found myself a bit inconsistent about this, resulting me messing my whole scripts as it grow larger. Thanks in advance.

:bust_in_silhouette: Reply From: magicalogic

Godot’s script editor has a tab on the left side where you can access and filter methods in a script so the position of the method in the script should not matter.