[v2]: Put the most frequently used function parameters ahead of the rest
Posted: 30 Dec 2022, 21:42
v2:
Some functions have "essential" parameters and "less essential" parameters. For example, a MsgBox always has a message, and sometimes has a title or options. Therefore, a decision was made for the MsgBox syntax to look like this.
MsgBox([Text, Title, Options])
Now consider the case of a Gui text control. It always has text (or a plan to have text), but options are often absent. Nonetheless, the syntax is "backwards", as follows.
MyGui.AddText("Options", "Text")
The suggestion here is to swap the options with the main content-- text in this case-- and to do so for all other functions with this same issue. This would make the essential parameter the first parameter.
Some functions have "essential" parameters and "less essential" parameters. For example, a MsgBox always has a message, and sometimes has a title or options. Therefore, a decision was made for the MsgBox syntax to look like this.
MsgBox([Text, Title, Options])
Now consider the case of a Gui text control. It always has text (or a plan to have text), but options are often absent. Nonetheless, the syntax is "backwards", as follows.
MyGui.AddText("Options", "Text")
The suggestion here is to swap the options with the main content-- text in this case-- and to do so for all other functions with this same issue. This would make the essential parameter the first parameter.