2D-Character-Controller icon indicating copy to clipboard operation
2D-Character-Controller copied to clipboard

Naming Convention

Open zanqwq opened this issue 5 years ago • 3 comments

What's the naming convention means by starting by m_ and k_?

zanqwq avatar Aug 13 '19 10:08 zanqwq

I'm new, but I think it might make it easier to call on those functions in the future as all you have to do is type "m_" and then it should provide you with all of the things you have named that way.

FanSeaJay avatar Oct 27 '19 22:10 FanSeaJay

m is a prefix for a global variable (variable that can be accessed in the entire script across multiple sub routines.) k is a prefix for constants.

WaltersAvenger avatar Dec 11 '19 16:12 WaltersAvenger

m = member k = constant (Even though I have not read the k-variant before)

Read Hungarian notation: https://en.wikipedia.org/wiki/Hungarian_notation It makes it fast to see what type of variable it is by name, but with moderns languages and editors makes the Hungarian notation a bit outdated. But once in a time, useful.

always writing "" or "m" as prefix for a member variable could be replaced with "this." i java or c#, but that is even more to write, so "m", "" or "m_" is quite common even now 20+ years later. :)

S1Zr avatar Jan 08 '20 11:01 S1Zr