Open Stevoisiak opened 7 years ago
Good question.
I definitely prefer ProperCase over any other alternatives.
Since MsgBox
is also a command, it should be ProperCase as well. What do you think?
I like guest3456's suggestion on the AHK forums.
if
, else
, return
, while
MsgBox
, Send
, WinActivate
The only downside is that the distinction between the two categories could be confusing for commands like IfWinActive
, SetTimer
, OnExit
.
I haven't really put enough thought into the best style for variable names.
As for variable names, RaptorX suggests using a mix of lowercase and CamelCase. (strLength
, fstLetter
, myString
)
@aviaryan After doing some more research, I think it makes more sense to look to jNizM's AHK Syntax Highlighting addon for Notepad++ for guidance. (also on GitHub)
Like guest3456 had suggested, the AutoCompletion addon uses CamelCase for regular commands and functions. However, the implementation of control flow statements is a bit inconsistent.
In the provided screenshot, control flow statements like if
, return
, loop
, and byref
are lowercase. However, in my personal testing (image below), I've found that the autocomplete recommends CamelCase for these statements.
(Note: Color differences are due to me using the Default AHK theme, while the official screenshots use the "Lazy" Theme.)
Can there be a section discussing a consistent capitalization style for commands and variables?
Most coding guides seem to use a mixture of lowercase and CamelCase. Take this example from the AutoHotkey Beginner tutorial.
Even this repository mixes CamelCase and lowercase. (Examples from Flow of Control and Commands)