Enum Naming Convention – Plural

Microsoft recommends using singular for Enums unless the Enum represents bit fields (use the FlagsAttribute as well). See Enumeration Type Naming Conventions (a subset of Microsoft’s Naming Guidelines). To respond to your clarification, I see nothing wrong with either of the following: or

What is the purpose of the single underscore “_” variable in Python?

_ has 3 main conventional uses in Python: To hold the result of the last executed expression in an interactive interpreter session (see docs). This precedent was set by the standard CPython interpreter, and other interpreters have followed suit For translation lookup in i18n (see the gettext documentation for example), as in code like raise … Read more

What is a good naming convention for Unity?

The Unity convention is actually rather simple: everything is Pascal-cased, types (classes, structs, enums) and methods start with upper-case, fields and properties with lower-case. Enum values in upper-case, constants in lower-case (usually). So ClassName, MethodName, myField, myProperty { get; set; }, MyEnum.CaseA… that’s it. As for your example, Transform is a class, whereas transform is an accessor to the instance of Transform in that particular GameObject/Component. … Read more

Should Python class filenames also be camelCased?

The following answer is largely sourced from this answer. If you’re going to follow PEP 8, you should stick to all-lowercase names, with optional underscores. To quote PEP 8’s naming conventions for packages & modules: Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. And for classes: Class … Read more

What is the difference between .yaml and .yml extension? [duplicate]

File extensions do not have any bearing or impact on the content of the file. You can hold YAML content in files with any extension: .yml, .yaml or indeed anything else. The (rather sparse) YAML FAQ recommends that you use .yaml in preference to .yml, but for historic reasons many Windows programmers are still scared of using extensions with more than three characters … Read more

What is the meaning of single and double underscore before an object name?

Single Underscore Names, in a class, with a leading underscore are simply to indicate to other programmers that the attribute or method is intended to be private. However, nothing special is done with the name itself. To quote PEP-8: _single_leading_underscore: weak “internal use” indicator. E.g. from M import * does not import objects whose name starts with an … Read more

“items list” or “item list”

In English, a “collection of stamps” is a “stamp collection”. (At best, “stamps collection” would be understood). In programming, I’m not entirely sure why, but we1 do sometimes use the form “StampsCollection”. It may be because we try to use more precise and logical lingo than traditional English provides; we start with the name “Item”, pluralise it to “Items”, then be precise … Read more