ahk2 extension

Discuss the future of the AutoHotkey language
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

ahk2 extension

28 Sep 2017, 16:56

I wanted to bring this topic up, but first I searched for it to ensure it wasn't discussed yet. The result is somewhat encouraging:
lexikos wrote:
guest3456 wrote:Because of this change, should discussion be revisited about moving to a new file extension?
I don't see any connection between this and that. If you and others wish to discuss it, please start a new topic. The main thing stopping me from using a new file extension is that there are none that feel right.
As said in the quote, command syntax removal alone might be not a good reason to create a new extension, and many (most?) functions already exist in 1.1. Sure, 2.0a brought new GUI structure and that sort of thing, but some other behaviours were actually changed (such as forced-expression isn't a thing any more I think, since everything acts as function, therefore is expression by default? Correct me if I'm wrong).

What I am concerned about is the "historical burden" - backwards compatibility. AHK exists for many years and plenty scripts/libraries has been written throughout the time. Search engines still frequently show up old forum results on top, even mentioning AHK_L as a branch back then. This leads to fact that in the future people might stumble upon code that no longer works with 2.0, maybe doesn't even do work with current 1.1. Assuming the code was downloaded as a file (which I suspect is often the case for projects shared on GitHub), one should notice that the extension is different. Sure it's not much, but always something to tell a part between versions.

Secondly, making a new extension allows to easily tell a part which exe (1.1 or 2.0) the script should run with due to Windows' file-association, also as tell the text editor of choice which syntax it should be highlighting and suggest/auto-complete functions or methods.

Lastly, to combine the two points above, forum code tag could have added code=autohotkey2 (or code=ahk2) to tell on sight this has been made for AHK2, highlighting syntax properly (rather than mess up with the previous) and linking to 2.0 documentation.




The argument against is that other languages usually don't make new extensions when they make major update, but on other hand they don't change the syntax that much either.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: ahk2 extension

29 Sep 2017, 11:02

Yet this isn't a "major update" it seems. It's just a totally new product, related of course, but the intent was never similarity, and I don't see why a new file extension wouldn't be proper. I think it would be easy enough to do.

Currently I'm doing awkward things like creating shortcuts to "AHK v2 path" "script written in v2.ahk" and running them. There would probably be better ways....
try it and see
...
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: ahk2 extension

29 Sep 2017, 16:39

You can change extension of your 2.0a scripts to something else and run it with AHK 2.0a - they will work just fine. My goal though is to make it official / agreement that *.ahk2 will be used instead of just *.ahk for the reasons mentioned.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: ahk2 extension

29 Sep 2017, 17:06

I hadn't really spent much time thinking about that, but I realize now it is easy to set up another file extension.
try it and see
...

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 4 guests