Spaces in function name.

0 favourites
  • 5 posts
From the Asset Store
Spaces Ambience
$8 USD
60% off
Spaces Ambience contains 102 Sounds: 53 track and 49 sounds
  • Are there any known disadvantages of using spaces in function names?

    I found this convention very readable to me and comfortable to work with. But as it is not the "normal" way of naming functions I started to think if it won't bring me some problems later? Performance maybe?

  • I just use underscores. Cam_GetX, Cam_DestinationReached, etc. Doubt it matters performance wise.

  • Functions are more-so coding realm (yes yes, Construct is "code free" but you can take it to the next level..functions are the next level). Typically (always) functions do not have spaces in them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Functions are more-so coding realm (yes yes, Construct is "code free" but you can take it to the next level..functions are the next level). Typically (always) functions do not have spaces in them.

    That is true. But in "normal" programming you can hermetize. You can do private/protected/public functions. In C2 once you import event sheet which contains the function it becomes global. So it's nice to do some distinction even by naming convention. And this separator (" -> ") really does the job when it comes to readability so I would really like to stick to it.

    The worry is how C2 is converting it to JS, if it is possible to have any problems cause of that or not. As we know JS is interpreted by the browser and might have slightly different behaviour... but in other hand... I'm thinking now that I'm sure Ashley would not allow spaces in function names if there would be a chance that this will bring any problems. So I think I'm safe.

  • [quote:2feohdlr]The worry is how C2 is converting it to JS

    I wouldn't worry. You can literally put any text for a function name without issues.

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