Minimize Repeating Class Names in Member Variable Names [VS4]

Minimize Repeating Class Names in Member Variable Names [VS4]

Tip VS4

Member variables are scoped within a class, which gives them extra context. Therefore, it’s usually not necessary to repeat the class name in member variable names, which can get tiring to read.

Similar principles can often apply to local variables within methods of a class too. It’s not always possible to avoid repeating class names in member variable names - sometimes, the extra specificity is important. But it’s something to aim for in many cases.

Consider the following example:

Tap into your teams collective wisdom ad.png