Discuss the future of the AutoHotkey language
Posts: 6212
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


11 Aug 2018, 21:06

Thinking about additional debug functions, such as a function to retrieve details from the call stack, it occurred to me that OutputDebug (which is named after the OutputDebugString function it calls) could be renamed to be more convenient and to start a convention for future debug functions. My current ideas are combinations of Dbg or Debug and Output or Print.

I lean toward Debug rather than Dbg, for clarity, and because after testing it out, "dbg" doesn't seem to be any faster for me (due to use of one finger vs. multiple). There's also auto-complete and hotstrings.

I generally use my own D function which just prints to stdout, anyway.
User avatar
Posts: 760
Joined: 06 Oct 2015, 21:39

Re: OutputDebug

12 Aug 2018, 05:51

I like Debug for the same reasons as you’ve mentioned
Posts: 2098
Joined: 11 Jan 2017, 17:59

Re: OutputDebug

12 Aug 2018, 08:17

autocomplete handles everything, so dont really care what the functions are called.
Posts: 3565
Joined: 17 Jul 2016, 01:02

Re: OutputDebug

21 Sep 2018, 07:50


I'm quite neutral in the matter of dbgXXX vs debugXXX. Just to note, there is already sort of a convention in naming functions, that is a three letter abbreviation, eg, strXXX, winXXX, maybe others.

In any case, it could be nice to have a positional directive to enable / disable / set options for such functions, eg, #Debug off would ignore all debug functions when parsing the script, example,

Code: Select all

#debug off
#debug stdOut
dbgPrint 'abc'	; Not going to happen
#debug on
dbgPrint 'abc'	; will show in stdout
#debug msgbox
dbgPrint 'abc'	; will show in msgbox
The directive could also apply (on / off) to udfs, named eg, dbg_XXX.

Obviously there will be problems if such functions are used in an expression, eg, #debug off `n if dbgPrint('abc'), I think it is ok though.

Posts: 99
Joined: 21 May 2015, 18:21

Re: OutputDebug

30 Sep 2018, 10:52

I would prefer "Debug" over "Dbg".

I also agree with Helgef; I would find a directive or command to disable debug output very useful.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 2 guests