-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unused values as warnings #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm a bit split on this.
I can see how it may be useful to know at a glance whether a value is used or not. VS already displays unused values in a muted colour, so in the IDE it's clear which values are unused.
On the other hand, I have often found it equally (if not more) nice to know at a glance what a parameter actually is, even if unused, and names help with this. For example, it becomes easier to make use of a parameter later when needed.
It is not obvious to me that one always trumps the other, and I'm therefore not sure that it should be a warning.
For example, in the samples, I think I generally prefer names: the samples are deliberately intended to help new users, and I think (at least in bindings) they might appreciate (slightly) descriptive names more than knowing whether they're unused (which, again, VS makes clear anyway).
In any case, given that I don't think it's generally a given which option to prefer, I have never turned on --warnon:1182
. (This is also combined with the fact that I usually always turn on <WarningsAsErrors />
, forcing me to fix warnings.)
In summary, I'm not sure I'd like to turn the warning on.
(I have not yet gone through and considered each individual parameter renaming.)
What do you think, in light of the above reasoning?
I think code should be optimized for reading since that is the typical case. If someone is going to write new code in that area, then they can look at the type to quickly determine "what a parameter actually is". In this case of |
I agree that |
A simple compromise would be to only add |
You make good sense. I can agree that code should be optimized for reading. I can accept the changes to the main project. I can also accept most of the changes to the samples. Apart from the Also, instead of |
I would prefer to squash some commits before merging |
Let me know when you're ready! |
This is the only way that I know how to do it in the project file. I have found this part of devops rather confusing. On the one had, there is very clear information about what options |
cfd9f58
to
e1651c1
Compare
Ready :) |
Thanks a lot! |
First commit modifies
fsproj
files to turn unused values into build warnings. The second commit deletes one unused line of test code. The third commit renames all unused values to_
.