What are some best practices for keeping script neat? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
A_Perry_1984
Posts: 76
Joined: 07 Dec 2018, 12:08

What are some best practices for keeping script neat?

24 Oct 2019, 18:11

This is more of a general question than AHK specific. I would like to post some of my scripts for others to use, but would like them to be more polished. I have been writing scripts off and on for a while, but I have never really figured out a best practice for keeping my scripts readable and organized. What are some recommended practices from the experienced? Examples: Where do I put functions, glabels, variables, comments for easy viewing ETC?
Lichtathlet
Posts: 6
Joined: 14 Oct 2019, 07:54

Re: What are some best practices for keeping script neat?  Topic is solved

25 Oct 2019, 07:41

I split ahk files by function and include them in a master file.

eg.
custom settings

#include browser.ahk
#include word.ahk
#include excel.ahk

Of course there are some limitations when it comes to global variables etc.
So far it works out well for me.
Sid4G
Posts: 49
Joined: 02 Apr 2016, 19:11

Re: What are some best practices for keeping script neat?

25 Oct 2019, 09:03

If they don't know much scripting, separating functions in different files will only make it more difficult to understand.
It's best to sort everything logically and add comments, what everything does and what is safe to change and how to do it.

Return to “Ask For Help”

Who is online

Users browsing this forum: Ackis, AHKStudent, Google [Bot], mitsakos156, swagfag, teadrinker and 220 guests