Skip to content

Instantly share code, notes, and snippets.

@Chunjee
Last active March 25, 2022 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chunjee/e8bdafddebfcd2c4dde50fe2578735c4 to your computer and use it in GitHub Desktop.
Save Chunjee/e8bdafddebfcd2c4dde50fe2578735c4 to your computer and use it in GitHub Desktop.
biga.ahk plugin formatting

A brief guide to consistant biga.ahk plugin formatting

example packages

frequencies_bigaplugin.ahk

package naming

packages ideally should be named {{name}}_bigaplugin.ahk in all lowercase

Good:

mycoolmethod_bigaplugin.ahk
ai_bigaplugin.ahk

Bad:

myCoolMethod_bigAplugin
aibigaplugin

class naming

The classname follows the package name exactly but does drop the .ahk ending

Good:

class mycoolmethod_bigaplugin {

method naming

methods should follow "camelCase" naming convention; begining with a lowercase character.

Good:

	myCoolMethod() {
		; do something
	}

code arrangment

Unless your plugin is extra special; it should follow the following template, modifing the base class at the top.

The ideal plugin is self containted and does not add helper functions or attempt to #Include other packages.

Good:

biga.base := mycoolmethod_bigaplugin

class mycoolmethod_bigaplugin {
	myCoolMethod() {
		; do something
	}
}

Bad:

#Include <HelperFunc>
biga.base := mycoolmethod_bigaplugin

class mycoolmethod_bigaplugin {
	myCoolMethod() {
		fn_helper()
	}
	myOtherCoolMethod() {
		HelperFunc()
	}
}

fn_helper()
{
	; do something
}

helper methods

methods not intended for direct use should be prefixed with "_internal" or "_"

Good:

biga.base := mycoolmethod_bigaplugin

class mycoolmethod_bigaplugin {
	myCoolMethod() {
		; do something
	}

	_internal_myHelperMethod() {
		; do something
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment