-
Notifications
You must be signed in to change notification settings - Fork 103
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
Prevent block comments #486
Labels
Comments
I agree that line comments are preferable. However, finding block comments requires semantic analysis, in the general case. EditorConfig supports editors that do not have analysis capability. I am therefore not sure if EditorConfig is the right place for this setting. E.g., I would expect to see this in a linter config. |
👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Block comments" are evil. They are especially used to disable a large part of code easily but when you do that it becomes hard to read the code. The difference is not obvious in the Pull Request. Just two lines of difference which in fact disables maybe hundreds of lines of code. You inspect lines and lines of code just to realize that that code does not run because it is put inside a block comment.
Line comments on the other hand are angels. Every affected line of code is changed when a line comment is applied so you never miss that line in the Pull Request.
IDEs like IntelliJ, VsCode usually print the commented block with a different color so the hardship I mentioned is not felt so deeply. But when going through the Pull Request outside the IDE, the issue becomes prominent.
A new configuration option should be introduced to "Prevent block comments" or "automatically turn block comments into line comments".
The text was updated successfully, but these errors were encountered: