From the course: Agile Software Development: Clean Coding Practices
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Parameter names
From the course: Agile Software Development: Clean Coding Practices
Parameter names
- [Tutor] The rules for crafting clean parameter names are very similar to the rules that are used for variable names. Prefer singular nouns when naming a parameter that contains a single value. Prefer plural nouns when naming a parameter that contains a collection of values. Use the noun version of a verb form when naming a parameter that is passing in a function or a closure. Avoid using single-letter parameter names, even when the parameters are part of a closure definition. Instead, spell the words out, remember, our goal is to limit the number of assumptions that must be made when reading the code later. Spelling these small words out clearly communicates the intended use of these parameters. Avoid using abbreviations and instead, spell the word out all the way. Avoid starting parameter names with capitalized letters, this will confuse them with classes or type names. When using multiple acronyms, make sure there's a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.