Skip to content
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

Multiple IDE Warnings #80

Open
TetraTheta opened this issue Jan 13, 2025 · 4 comments
Open

Multiple IDE Warnings #80

TetraTheta opened this issue Jan 13, 2025 · 4 comments

Comments

@TetraTheta
Copy link
Contributor

TetraTheta commented Jan 13, 2025

When I open this project as C# .NET Framework WinForm project in Visual Studio 2022, I see multiple IDE warnings.
Since these are just warnings, these can be ignored, but they bother me.


private IntPtr formHandle;

CS0169 IDE warns me about formHandle field is not used.


if (control is ComboBox comboBox)

CS0184 IDE warns me about provided expression (control) is not provided ComboBox type.




CS0108 FlatProgressBar.Minimum, FlatProgressBar.Maximum, FlatProgressBar.Value hides inherited member, ProgressBar.Minimum, ProgressBar.Maximum, ProgressBar.Value.
Use new keyword to hide inherited member.


Since I don't know if these are intended behavior or not, I'll leave an issue first.
If these are not intended behavior, rather than just suppressing warnings, I'd suggest actually fixing them.

@TetraTheta
Copy link
Contributor Author

Except for if (control is ComboBox comboBox), those warnings would be easily fixed.

I couldn't figure out how to fix that if (control is ComboBox comboBox) part, though.

@ChristanBeyond
Copy link

Since these are just warnings, these can be ignored, but they bother me.

Consider using: #pragma warning disable

@TetraTheta
Copy link
Contributor Author

TetraTheta commented Jan 23, 2025

Consider using: #pragma warning disable

If I learned right, suppressing warning should be only be done in these situations:

  • The warning is intended by design
  • The warning is unavoidable

I don't think these warnings fit in these situations, especially when those warnings can easily be fixed.


Ignoring those warning also hurts 'Quality of Code'. If those warnings are not that important, it would not be diagnosed as warning from the beginning.

To avoid unintended bug or crash caused by warnings, many IDEs including VS have an option that mark those warnings as critical error, to force programmer to fix that warning ASAP.

@ChristanBeyond
Copy link

Consider using: #pragma warning disable

If I learned right, suppressing warning should be only be done in these situations:

  • The warning is intended by design
  • The warning is unavoidable

I don't think these warnings fit in these situations, especially when those warnings can easily be fixed.

Ignoring those warning also hurts 'Quality of Code'. If those warnings are not that important, it would not be diagnosed as warning from the beginning.

To avoid unintended bug or crash caused by warnings, many IDEs including VS have an option that mark those warnings as critical error, to force programmer to fix that warning ASAP.

Well yes, but I've over 100 warnings for that script, so since it's just a library I added to the project, I don't want it to raise warnings. Hence I do use the #pragma warning disable line. Yes they should be fixed, but if it's bothering you, you can just disable it, that's all I'm saying. ¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants