[Suggestion] Constants as function names

0 favourites
  • 3 posts
  • Hi

    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_NAME

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 <img src="smileys/smiley1.gif" border="0" align="middle" />

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)