CamelCase

Place to post guides, observations, things related to modding that are not mods themselves.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 430
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

CamelCase

Post by BraveCaperCat »

Why do the developers use snake_case (or snake-case when not using lua) and not CamelCase? They should always be consistent but... why did you pick one over the other? They seem to be just as good and error_free and ErrorFree.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: CamelCase

Post by DaveMcW »

I suspect it's because the C++ code is written in CamelCase (see the internal class names here), and they want an easy way to keep the lua functions distinct.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 430
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: CamelCase

Post by BraveCaperCat »

DaveMcW wrote: Wed Dec 04, 2024 1:58 am I suspect it's because the C++ code is written in CamelCase (see the internal class names here), and they want an easy way to keep the lua functions distinct.
Ah. I don't use the control scripting side of factorio modding very much (more of a prototype person) so it now makes sense why they would use CamelCase and snake_case in the C++ and lua code respectively.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
Post Reply

Return to “Modding discussion”