Starting a new project, but with which AHK version?

Get help with using AutoHotkey and its commands and hotkeys
Josh
Posts: 2
Joined: 09 Feb 2018, 03:56

Starting a new project, but with which AHK version?

09 Feb 2018, 04:52

First some background info…

In 2010-2011 I created a backup management software using AHK (about 7500 lines of code). The software had an interface to one commercial file and folders backup software, one disk imaging software, an e-mail client, hard disk monitoring software, zipping software, a few file checksum utilities etc. The software used Winsock (AHKsock) to do some IPC with two background processes. The user interface was purposely minimal, consisting mainly of one taskbar icon with a three-stage popup menu and some tooltips and traytips.

At that time AHK V1.0 had recently frozen to its last version, and (IIRC) AHK_L and AHK_H were under development and considered being promising products, but not as mature or stable as AHK V1.0 was at that time. Therefore, I chose AHK V1.0 as my tool to create the product.

I developed the product originally for Windows XP, and it turned out to work fluently also on Windows 7. However, Windows 10 has changed the situation. Now I have a need to redesign some parts of the program, and I am planning to replace the underlying imaging backup software with another. So, I have a need to rewrite my application for most parts, although I suppose I can still use e.g. some algorithms I had developed to optimize the backup disk space utilization.

Now, in 2018, AHK V1.0 is clearly history, AHK_L (AHK V1.1) may start to be approaching the same state as what V1.0 was in 2010, and AHK V2.0 seems to be coming somewhere around the corner...

I'm currently struggling on which AHK version I should choose to start developing the second generation of my backup management software.

My understanding is that AHK V1.1 is now stable, so it would obviously be the safest choice, I guess. On the other hand, I will be developing the software on my free time, so I expect it to be finished maybe somewhere around the summer 2019, which means after 1.5 years from now. I would like to maximize the life cycle and maintainability of my "product V2", so I guess that I have to spend some time considering if V1.1 really is the best bet for me…

I understand that AHK V2 is currently in alpha stage, meaning that e.g. the syntax can still change, and there is no ultimate guarantee that it will ever be finished. On the other hand, when reading the forum posts, I have got the feeling that some people are already using it, and I think that my use case would be pretty simple when thinking of what AHK features I need to use.

Then I noticed that pretty many of the AHK V2 features (or syntax) have been backported to AHK V1.1. I wonder if that could be a reasonable compromise between V1.1 and V2.0, considering that I expect my new product to be finished somewhere mid 2019?

So, I would be grateful to hear your opinions on how I should emphasize the pros and cons of selecting AHK “V1.1” / “V2.0” / “V2.0 features backported to V1.1” when deciding which version to use when rewriting my backup management software.
BoBo
Posts: 2073
Joined: 13 May 2014, 17:15

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 09:00

The software had an interface to one commercial file and folders backup software, one disk imaging software, an e-mail client, hard disk monitoring software, zipping software, a few file checksum utilities etc ...
Would you mind to name those applications? Do you have a process flow at hand that you can share it with us?
tankuser
Posts: 7
Joined: 29 Sep 2013, 16:04

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 10:42

In general based on your lengthy and concise post, my suggestion is 1.1. Even if V2 were released tomorrow support for 1.1 would remain for the foreseeable future. It is unlikely at this stage that new meaningful bugs will be discovered. Whereas with V2 new meaningful bugs could be discovered yet.
Josh
Posts: 2
Joined: 09 Feb 2018, 03:56

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 10:45

I think that the product names are not relevant, and I'm going to change some of them now for various reasons. I'm still testing and do not even know which products I'm going choose for the next major release... After I have made the decisions, I can tell the names if there is interest.

But which version should I choose for AHK: V1.1 or V2.0 alpha or V1.1 with V2.0 syntax backported to V1.1?
BoBo
Posts: 2073
Joined: 13 May 2014, 17:15

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 11:13

I'm still testing and do not even know which products I'm going choose for the next major release...
That's the reason why I'm asking. Let's assume there are newer/other tools around and there's the potential to shrink your (unknown) code to 5% of its current size :mrgreen: for that it might make sense to know your current tools (and for what of its special features you've chosen it).

I'd go with 1.1.x for the moment as you'll find more already available code for it + its "Kinderkrankheiten" are gone (or under a sort of control). Good luck 8-)
User avatar
jeeswg
Posts: 3543
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 14:41

- If the project uses a lot of GUIs, then AHK v2 might be better.
- If using AHK v1.1, I would use the more future compatible AHK v1.1 functions e.g. not SetFormat/StringReplace/StringSplit, but instead Format/StrReplace/StrSplit. Those are the main commands that are fiddly to convert or require manual conversion, if you wanted to convert your AHK v1.1 script to AHK v2 at a later date. Also, I would assign using :=, and use expression-style if statements using parentheses.
- Since AHK v1/v2 current versions to AHK v2 final version, will both require some conversion, it might be easier to stick with AHK v1.1, and convert later.
- There are more comments about conversion issues here:
AHK v1 to AHK v2 conversion tips/changes summary - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=36787
FanaticGuru
Posts: 900
Joined: 30 Sep 2013, 22:25

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 15:51

I would agree with the logic of jeeswg and use the latest version of AHK v1.1 but with an eye to using more AHK v2 friend techniques for easy conversion if wanted at a later date.

The biggies are always use := for assignments and = for comparisons. And if a built-in function is available always use it over the command.

If you code in AHK v1.1 and try to keep it AHK v2 friendly then later you should be able to convert even a large script in maybe a day.

If you are going to use other peoples libraries then AHK v1.1 is almost a most as there is much more AHK v1.1 stuff out there. That is the biggest thing with converting to AHK v2 is that it breaks a lot of library code that can be very complex and often beyond the ability of many users ability to convert as they don't really understand the code to start with. Not as bad as converting some libraries from 32 to 64 bit though which is what happened a lot going from v1 basic to v1.1.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
Masonjar13
Posts: 1205
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Starting a new project, but with which AHK version?

09 Feb 2018, 18:57

Agreed; v1.1, avoid commands that aren't v2 friendly. If you need to use them, consider making comments so they're easy to find to replace if switching to v2. I'd also recommend making your code as modular as possible, even if it means going a bit out of your way to do so. In the long run, it will make maintenance significantly easier.

And BoBo is correct in that your code can likely be reduced significantly. First and foremost should always be efficiency, however. Combine that with a modular paradigm and you're good to go!

Return to “Ask For Help”

Who is online

Users browsing this forum: BBomb007, boiler, n1ce0n3, sloepoke and 49 guests