My AHK v2 Priorities

[first released: 2022-12-16]
[updated: N/A]


AHK V2 Priorities: Breaking Changes

[some changes are just too important, for AHK v2.1, if not AHK v2.0]
[with a warning in AHK v2.0 that functionality will change]
• Loop Files -> LoopFiles [same for Loop Reg]
• Loop Parse -> LoopParse [same for Loop Read] [and perhaps needs consistency with StrSplit]
• Loop Parse String CSV -> LoopParseCSV String
• //: make it do floor divide (like Python) (add ~/ for integer divide, like Dart) [supporting both is important]
• NumPut: CRITICAL: restore the AHK v1 parameter order [introduce NumPutPairs]
• A_ScriptName: make it read-only [scripts rely on it being the script name always][introduce A_ScriptTitle]
• RandomSeed: maintain this [my 'AHK v2 functions for AHK v1' library shows one way]
• StatusBarGetText/StatusBarWait: add Control parameter (as variants for 'msctls_statusbar32' are common)

NumPut

• NumPut-pairs-style is awkward when you have an array of values, you'd have to add a Type for each Value. I'd rather NumPut-classic-style, and have Value accept an Array.
• For speed/simplicity, I VERY much value when read/write functions have matching parameter orders (e.g. IniRead/IniWrite).
• The differences between v1/v2 are going to be a MASSIVE ETERNAL headache (and source of bugs).
• (Minor point: For newbies, if you use NumPut(t1,v1, t2,v2, t3,v3, ...), it's not clear what the offset for v3 is, should you want to use NumGet. This is avoided with an individual NumPut for each value.)
• NumPut multiple values is a very poor substitute for HexPut/Base64Put, and very much incompatible with other programming languages.
• Cut your losses. Just have 2 functions. 'Pairs' and 'Classic'. NumPutPairs/NumPut.
• If requests pile up for NumPut classic to be ported to AHK v2, then even better/more practical to also keep the original function name. (And give NumPut-pairs-style a new name.)
• (NumGet could have an option/parameter to retrieve multiple values as an Array.)
• [Please make your voices heard, sometimes compromise is needed, I'm suggesting 2 'NumPut' functions instead of one, to solve this major problem, that's all.]
• [Other problems, for less-used functionality, I can work around without too much trouble, but not this one.]

Loop Files

awkward (and unclear for newbies):
Loop Files Pfx FilePattern, FileOpt
2 ways to do it, bad for script maintenance:
Loop Files Pfx FilePattern, FileOpt
Loop Files, Pfx FilePattern, FileOpt
the best (matches v2 commands rationale: no subcommands, no commas after command names):
LoopFiles Pfx FilePattern, FileOpt
(plus it can be backported)


Two-Way Compatibility (Functions)

• AHK v1(/v2): '&' for VarRef function parameters [or lazy option: AHK v1 'MyFunc(&var)' identical to 'MyFunc(ByRef var)']
• AHK v1(/v2): 'MyFunc(var:=unset)' for function parameter default values [can then be checked with IsSet]
• AHK v1/v2: 'VarRef(var)' 'function' (like AHK v2 '&var') [or lazy option: in AHK v1 only: 'VarRef(var)' 'invisible' like passing 'var']

Two-Way Compatibility (Other)

[reduce the clutter of defining 'DQ'/'IsUnicode' in multiple functions]
• AHK (v1/)v2: A_IsUnicode [or A_IsUtf16/A_IsWide/A_ChrSize (and A_WA)] [this may also be useful for: UTF-8-AHK-for-Linux/UTF-8-AHK-v2-'ANSI']
• AHK v1(/v2): 'Loop (expression)' [and/or Range class]
• AHK v1(/v2): Object.Has()
• AHK v1/v2: A_SQ/A_DQ [IMO too useful to be without them, Chr(39) and Chr(34)]
• AHK v2: SplitPath return object [with a custom backport for AHK v1]
• AHK v1: '#If WinActive()' (optimised)


At Some Point (I Provided C++ Code)

• AHK v1(/v2): Buffer object support
• AHK v1(/v2): Object.Count/Object.Length [perhaps via a directive] [or a way to alter all arrays e.g. StrSplit and custom function variadic parameters]
• AHK v1/v2: Array.Reverse()
• AHK v2: Array.Sort() [I wrote AHK v1 custom backport code]
• AHK v2: ControlXXX/EditXXX: allow Control to be omitted
• AHK v2: improved/simplified ControlClick
• AHK v2: NumGet/NumPut: array support [and move the 'Pairs' style to a separate function]
• AHK v1/v2: HexGet/HexPut/Base64Get/Base64Put
• AHK v1/v2: RemoteBuffer (for external process interaction, optimised for internal process interaction too)

At Some Point (I Created AHK Demo Code)

• AHK v2: JSON: JSArray [0-based array, with IndexOf/LastIndexOf/Join methods]
• AHK v2: JSON: JSObject [insertion-order map, with case-sensitive string key names, that takes '.property' and '[key]' syntax, with a HasOwnProperty method, and an enumerator like an Array/Map so JSArray/JSObject for loops can use the same syntax]
• AHK v2: JSON: JSONParse/JSONStringify [JSONStringify is lower priority] [maybe special True/False/Undefined types]
• AHK v2: FormatTime: removed limitation: 'date and time elements together, they must not be intermixed'
• AHK v2: Object(Options, Values*) [a handy way to create bespoke objects e.g. a case-insensitive map, e.g. create a map using object syntax]

At Some Point

• AHK (v1/)v2: make classes position-independent (like AHK v1/v2 functions and AHK v1 classes)
• AHK v1(/v2): switch statement: 2nd parameter [protect users in AHK v1, since it doesn't throw]
• AHK v2: <> [equivalent to !==]
• AHK (v1/)v2: perhaps A_AhkVersionEx/A_AhkVersionFull/A_AhkVersionFriendly (e.g. 'AutoHotkey v1.1.33.00 32-bit Unicode')
• AHK v2: A_ScriptXXX/A_AhkXXX should probably point to the exe in compiled scripts
• AHK (v1/)v2: for #Include: perhaps A_V1/A_V2/A_V3/A_V4 or A_AhkVersionMajor/A_AhkVersionMinor or similar could be used with #Include (cf. OSVERSIONINFOW structure)
• AHK (v1/)v2: for #Include: perhaps: A_ScriptName (read-only)/A_ScriptNameNoExt/A_AhkNameNoExt/A_AhkDir
• AHK (v1/)v2: DllCall: handle 'Variant' Type [for DllCall one-liners that work in both 64-bit/32-bit]
• AHK (v1/)v2: WinTitle: ahk_opt e.g. V/VH/H, eQuals/Contains/Starts/Ends/RegEx
• AHK v2: WinActive("A") returns 0 while switching windows, have a short 'retry' period if it returns 0
• AHK v2: perhaps % (or mod) and %% [for integer Mod and FloorMod]
• AHK v2: 'local' to work like AHK v1: any variable not used as in 'var(', is made local
• AHK v1/v2: ListVars: show at least 260 characters
• AHK v1/v2: duplicate hotkey: it states line where duplicate appears (also state line where it first appears)
• AHK v2: FileMove when a dir is specified could be an error
• AHK v2: a way to redefine a BIF in AHK v2 (e.g. make wParam/lParam for PostMessage/SendMessage compulsory)
• AHK v1: var := 'abc' [low priority for me][maybe simple one-liners that use single quotes]
• AHK v2: functions that use VarRef output parameters, could also use object return values
• AHK v1: perhaps a directive so that creating a class, also creates a corresponding 'function', consistent with AHK v2
• AHK (v1/)v2: perhaps allow underscores in numbers e.g. '1_000_000'
• AHK v2: split Thread: e.g. ThreadPauseTimers/ThreadPriority/ThreadInterrupt (and/or A_ variables)
• AHK v1: perhaps a directive, more warnings (e.g. if a function receives too few parameters, if a method doesn't exist)
• AHK v2: InputBoxExit(Prompt,,, Default) [on Cancel/Timeout, ends the thread]
• AHK v2: InputBox(Prompt,,, Default, &Result) [if Result param used, it returns the output value, NOT AN OBJECT]
• AHK v2: GUI menu objects: create menu items and specify ID numbers
• AHK v2: GUI objects: B/R support (like X/Y/W/H)
• AHK v2: GUI objects: support for accelerator keys ('soft' hotkeys that can be overriden by other scripts, cf. 'hard' hotkeys)
• AHK v1/v2: specify all 4 systray icons
• AHK v2: () FileRead/File object: consistent unknown character: ? v. Chr(0xFFFD)
• AHK v2: () FormatTime: 'FormatTime, vWDay, % vDate, WDay' gives 2 even when the date is invalid, but if that's just the behaviour of the Winapi function, then that's a legitimate argument to do nothing re. this
• AHK v2: () if feasible, to make hotstrings more like hotkeys re. #If and the 'global variant': 'it will fire only if no other variant is eligible (this exception does not apply to hotstrings)'
• AHK v2: () review wait periods msec v. second [and whether 0.5 should be the default or not]
• AHK v1: () #SuspendExempt, and Suspend() at start of a hotkey subroutine
• AHK v1: if necessary, support for 'catch Any as var' and 'catch Any'
• AHK v2: formatted strings (new-style): e.g. F"abc ${var} def"
• AHK v2: formatted strings (old-style): e.g. D"abc %var% def"
• AHK (v1/)v2: an Acc 'search' function, similar to querySelector/querySelectorAll


The Following Is All Flexible:

Loop Is Slow

'Map' method (as in 'modify')
'Filter'/'Partition' methods
RangeObj.ToArray()
NumGet/NumPut array support
StrRept
StrJoin (and perhaps Array.Join())
StrEquals (and perhaps Array.IndexOf())
Array.Reverse()
Array.Count
StrSplitLen
HexPut/Base64Get/Base64Put

Accessibility

large font mode [MsgBox/InputBox/ToolTip]

Perhaps Custom Code For The Documentation

Assert()/AssertError() [for test code]
TickCount() or similar [precise values for benchmark tests]

Monitor Hotkey Presses

OnHotkey [how else can we: record/display every time a hotkey/hotstring is executed]

Importance Of Built-In Functions

the right function can help reduce #Include hell (script interdependency)
functions which use too many custom functions, can be difficult to share on forums