3 ms·
It also completely misses the point of why comments are useful. "Store user.age in age variable", is a useless comment which is indeed better expressed with cl
by xorcist 3y ago
It also completely misses the point of why comments are useful.
"Store user.age in age variable", is a useless comment which is indeed better expressed with clear code.
"Store user age in struct because when xyz() iterates over this it has no way to access the user object" is useful because it tells us why something is done, where it is used, and why the obvious solution isn't right.
- PH95VuimJjqBqy 3y agoI fought and lost this battle with one of our teams. The tech lead insisted they use XML comments (Visual Studio) for everything. ///<Summary> ///Represents the User ///</Summary> public class User { ///<Summary> ///Users Age //</Summary> public int Age {get;set;} ///<Summary> ///Users First Name //</Summary> public string FirstName {get;set;} } ad nauseum. Here's the thing. Swagger (.net) can pick up the XML file generated from these comments and it gives developers the ability to add more information to the Open API Spec file (swagger generates a UI off of it). So it has a legitimate use, but if you don't have anything than to repeat what the damned code already says, it's harmful to the readability of the codebase.