Spaces in function name.

Discussion and feedback on Construct 2

Post » Tue Jan 26, 2016 8:33 pm

Are there any known disadvantages of using spaces in function names?

Image

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?
ImageImageImage
B
27
S
16
G
79
Posts: 1,013
Reputation: 44,245

Post » Tue Jan 26, 2016 9:44 pm

I just use underscores. Cam_GetX, Cam_DestinationReached, etc. Doubt it matters performance wise.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Tue Jan 26, 2016 10:22 pm

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.
B
43
S
18
G
8
Posts: 500
Reputation: 8,445

Post » Tue Jan 26, 2016 10:31 pm

humanescape wrote: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.
ImageImageImage
B
27
S
16
G
79
Posts: 1,013
Reputation: 44,245

Post » Tue Jan 26, 2016 10:47 pm

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.
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests