-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Cleanup] Replace comments with named arguments #10018
Labels
Comments
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. |
ThomasGoulet73
added a commit
to ThomasGoulet73/wpf
that referenced
this issue
Nov 13, 2024
Contributes to dotnet#10018
ThomasGoulet73
added a commit
to ThomasGoulet73/wpf
that referenced
this issue
Nov 13, 2024
Contributes to dotnet#10018
ThomasGoulet73
added a commit
to ThomasGoulet73/wpf
that referenced
this issue
Dec 20, 2024
Contributes to dotnet#10018
ThomasGoulet73
added a commit
to ThomasGoulet73/wpf
that referenced
this issue
Dec 30, 2024
Automated changes. Contributes to dotnet#10018
ThomasGoulet73
added a commit
to ThomasGoulet73/wpf
that referenced
this issue
Dec 30, 2024
Manual changes. Contributes to dotnet#10018
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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: