From the course: Agile Software Development: Clean Coding Practices

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Constant names

Constant names

From the course: Agile Software Development: Clean Coding Practices

Start my 1-month free trial

Constant names

- [Instructor] There is a lot of variability in how different language communities encourage crafting constant names. We'll start by looking at the elements that are commonly agreed on before digging into the exceptions. If you dig hard enough, you'll find a language that does not agree with some of these rules. The first letter of a constant's name should be capitalized. Use singular nouns to name constants that contain primitive values. Use plural nouns for constants that contain a collection of values. Avoid using a constant name with just a single letter or an abbreviation, instead spell that word out completely. When using multiple acronyms ensure that there is some separation between each one. When naming enumerations, the enumeration type should be a singular noun. And members of the enumeration should be consistent with the type that contains them. For example, having an action named red doesn't make a lot of…

Contents