05.07.2012, 16:58
The layout I'm trying to keep in my scripts:
Includes
Defines
Macros
Variables/Enums
Stock functions
Regular functions
Public functions
Callbacks
Reason: before you can use a variable/function, you need to define it. I find it logical that definitions come before parts that use them. Callbacks use functions, functions use variables and variable definitions require defines (#define).
And it makes searching for definitions easier: go to top of the script (Ctrl + Home), use search (Ctrl + F) and the first result is the definition.
Includes
Defines
Macros
Variables/Enums
Stock functions
Regular functions
Public functions
Callbacks
Reason: before you can use a variable/function, you need to define it. I find it logical that definitions come before parts that use them. Callbacks use functions, functions use variables and variable definitions require defines (#define).
And it makes searching for definitions easier: go to top of the script (Ctrl + Home), use search (Ctrl + F) and the first result is the definition.