3 ms·
In C# there are #regions which are collapsible in the editor. Linters these days complain that they shouldn’t be used. Obviously if yin gave 9 functions that b
by alkonaut 8y ago
In C# there are #regions which are collapsible in the editor. Linters these days complain that they shouldn’t be used.
Obviously if yin gave 9 functions that belong in 3 groups of 3, you can argue that they should have a header but for most code I’d argue that more smaller things wins. I’d rather split it into 3 types and document the types even if the purpose of the split was mostly to get something to attach the comment to. The biggest issue with “free floating” comments (that aren’t for a statement, method, type or other code element) is that they tend to rot in the worst ways. Moving the code with refactoring tools won’t move the associated headers. When adding new code it’s easy to add under the wrong heading etc.
- irq-1 8y ago#regions are great. Syntax is the one issue (as you pointed out) but it could be better by adding a special comment code syntax and removing the closing. For example, a comment like //== wrappers for inherited functions where the equals work like in markdown headers, and the region continues until the end of scope or a new region.