[Suggestion] Constants as function names

Discussion and feedback on Construct 2

Post » Sun Feb 17, 2013 10:35 am


Just a small thing that i discovered using the functions plugin.

I think that the best practice for function names is to use a Constants as there names. A functions name is then only written once in the Constant and can easely be renamed.

In pseudo Construct2:
   Global variable FUNCTION_1_NAME = "function1Name"
   Event: Function On FUNCTION_1_NAME, do something...
and then also called with the constant
   Event: Function FUNCTION_1_NAMEAnAmuser2013-02-17 11:07:55
Posts: 4
Reputation: 410

Post » Sun Feb 17, 2013 8:38 pm

Ideally C2 should be able to update function names like instance variables or global variables, as opposed to allowing us to use global variables as function names (which would get messy).

So while I think that allowing constants as function names is the best idea, I do think that having the IDE update function names automatically just like instance variables or global variables would be amazing. I'm currently using wingrep on my game folder for any function name updates

boolean2013-02-17 20:40:05
Posts: 244
Reputation: 3,462

Post » Sun Feb 17, 2013 8:54 pm

I think that with the current setup, with functions being a plugin as everything else, then the quickest fix would be to let us use constants as function names.

If it is feasible then I would also prefere the solution with functions being defined the same way as instance variables.
Posts: 4
Reputation: 410

Return to Construct 2 General

Who is online

Users browsing this forum: ome6a1717 and 8 guests