Is there a Julia Style Guide?

I believe the case suggested for type name is actually PascalCase (as opposed to camelCase, where the first letter is lowercase).

It is possible, but ExpandingMan’s guide actually refers to it as `Upper camel-case’.

I was speaking more generally than Julia, but still in Julia… if UpperCamelCase (or PascaleCase) is used for structs/consts, why not keep the same convention with camelCase for the other variables instead of using _ ? (but again, more in general I see more and more usage of underscores than camelcases)

I suppose the idea is to make the distinction very apparent. If PascalCase is used for module and type names, FULL_UPPERCASE is used for the name of constants, and snake_case is used for variables/field and function names, then it is very apparent to what you are looking just by the casing of the identifier. We could probably blend camelCase into the mix attributing it to some group of identifiers. However, I find camelCase kinda awkward, it is strange to use it for identifiers that may start with an acronym (or continue to one), it is indistinguishable of snake_case if the identifier has only one word, and it is slightly less readable (but not much). So, I believe the main problem is that is kinda of a choice if you gonna have snake_case or camelCase (because of one-word identifiers the two do not coexist well), and snake_case ended up winning the fight.

5 Likes