Syntax and naming conventions?

Talk about anything
Posts: 12
Joined: 04 Feb 2018, 04:06

Syntax and naming conventions?

13 Feb 2018, 12:12

What sort of naming conventions and syntax do you use(if any) when writing your code. I find myself changing portions of my code until "I like it."

Just wanting to get some different perspectives here, because I see all sorts of variations out there. I know Autohotkey is case-insensitive, and so it doesnt usually matter how you write things.

Variable & Function Names:
I always use camelCase
I always use the := operator, even when it's not necessary.
I always put spaces around the operators.

Code: [Select all] [Download] GeSHi © Codebox Plus

firstName := "John"
lastName := "Doe"
firstLast := firstName " " lastName

I'll add more after I get off work, just wanted to start the discussion for now.
Last edited by Xeilous on 13 Feb 2018, 16:17, edited 1 time in total.
User avatar
Posts: 2550
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Syntax and naming conventions?

13 Feb 2018, 14:26

I use camelCase for variables, methods and function names.
I use CamelCase for class names.
I always use the := operator.
I always use the . operator to combine strings.
Lately I've started to use OTB.
I use a space after every comma. I use spaces before and after surrounding brackets.
I use [] for properties even if it isn't eneccessary. I use () with new even when it isn't neccessary.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Recommends AHK Studio
User avatar
Posts: 1034
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Syntax and naming conventions?

13 Feb 2018, 15:36

never use := %
:= is an expression.
single % forces a non-expression to an expression.
since := is an expression, single % is useless.
rawr. fear me.
Is it December 21, 2012 yet?
Posts: 12
Joined: 04 Feb 2018, 04:06

Re: Syntax and naming conventions?

13 Feb 2018, 16:15

Just noticed I did that by accident lol, typing this all out on my phone. I don't actually do the := % thing.

I think I did that because I'm so used to typing MsgBox, % varOne " " varTwo. That's where I got that from.

Return to “Offtopic”

Who is online

Users browsing this forum: No registered users and 2 guests