01 Apr 2017, 08:17
People keep saying that command syntax is easier for newbies, but what makes autohotkey easier to use is the fact that it doesnt require a full on development suite, it can run scripts with a double click, and it exposes a lot of automating functions and functions from the operating system into simple lines. Its the accessibility to doing things that makes it great, not its obsolete command syntax. What would all of the previously mentioned take, plus reading the winapi documentation, then creating the code in say c++, you could grab the autohotkey.exe, create a ahk then type FileExist(file) and doubleclick.
My view, commands could stay, but they should follow expression syntax, no more forcing them. Use quotes for strings and no quotes for variable names, but can keep the same format as in -> command, "string", "string", variable - instead of command, string, string, %variable%. Making them a direct alias to functions, as in command("string", "string", variable), being completely interchangeable and consistent, not only with its own syntax, but also with the syntax of every other scripting/programming language out there, being a good facilitator language to even more capable ones. Instead of the clusterfuck it currently is, that just causes more confusion for no reason, when people keep using unquoted strings in expressions and get no result. It's easy to say commands are easier for new users, when expressions get demonized.
That way you consolidate what variables are, what strings are, allows you to maintain a unified consistent documentation and get up to par with times. Not sure why commands keep following some syntax that chris created 14 years ago, that no other scripting or programming language uses. No one who is getting into ahk will tell you that "string" and variable is harder than string and %variable%, or that command("string") is harder than command, "string". It's usually the people reluctant to change that oppose it, for no logical reason, in the same sense they would oppose using another direct subtitute of <insert favorite product brand>.
AHK v2 should be full expressions with all commands using expressions, since its obvious commands are not going anywhere. Ever since the project started it was my understanding that ahk v2 was the modernization of ahk, hence why it was going to break backwards compatibility. Or at least have a directive that is set by default and makes all commands use expressions, instead of having to force them with %. In all fairness, if someone swears by command syntax %variable% and string, they should stay with AHK v1 because obviously they do not require the capabilities AHK v2 could offer. In this dawn and age, even the run o' the mill office noob is probably using excel macros with VB, or powershell scripts for their computer, and guess what, these two use expression syntax. At this point, expression syntax is more widely known than the not-used-anywhere-else ahk command syntax with its backward way of doing variables and strings.