You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the codebase, there are a lot of comments specifying an argument value is for what argument when calling a method. These comments were probably written before "Named Arguments" were introduced in C# 7 (Documentation).
Here's an example of code that could use named arguments instead of comments:
Replacing them would make the code more readable and improve the maintainability. It would improve maintainability because renaming the argument in the called method without renaming the named arguments in the calls to said method would break the build instead of making the comments innacurate (Some comments in the code base are already innacurate).
Unfortunately, it's not easy to automate this change. Some comments are to explain the value instead of naming the argument and some comments are innacurate (E.g.: The argument was renamed), this means that it requires some manual work. I'm able to make it work with a couple of regexes and some manual edits.
The text was updated successfully, but these errors were encountered:
I assigned this to myself since I plan on working on it. I already did it for a couple of projects locally but I wanted to open the issue for tracking and to have people's opinion.
In the codebase, there are a lot of comments specifying an argument value is for what argument when calling a method. These comments were probably written before "Named Arguments" were introduced in C# 7 (Documentation).
Here's an example of code that could use named arguments instead of comments:
wpf/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/XamlType.cs
Line 340 in 86ef9ee
Replacing them would make the code more readable and improve the maintainability. It would improve maintainability because renaming the argument in the called method without renaming the named arguments in the calls to said method would break the build instead of making the comments innacurate (Some comments in the code base are already innacurate).
Unfortunately, it's not easy to automate this change. Some comments are to explain the value instead of naming the argument and some comments are innacurate (E.g.: The argument was renamed), this means that it requires some manual work. I'm able to make it work with a couple of regexes and some manual edits.
The text was updated successfully, but these errors were encountered: