Hello
We are currently discussing internally whether we should add the following rule to our development guideline.
I'd like to know how you guys handle this.
- Local declared variables in CoC-Methods of extension classes must have a prefix/suffix
Assuming you have a base class with a member variable 'str test'.
You make an extension to this class and chain to an existing method. Now inside this CoC-Method, you declare another variable 'str test'.
This does currently not clash with the parents class member variable. There is no compile error, nor is the variable "overriden" in any way through the extension class.
Is it safe to assume this will stay this way? Or could this change and lead to a future compiler error with a platform update
Both variables are addressable through eitherthe local variable name test of the extension class, or through this.test of the base class.



Output:

Do you distinguish your local variable with a (e.g. company-) prefix or suffix?
Im aware of the microsoft docs entry Naming variables and methods added in extension classes, still it does not satisify our internal discussion.
How are you handling this?
Thanks!