Roadmap › Clean Code, Testing & Best Practices › Module: Readable Code
Lessons in this course (12)
3. Comments, formatting and magic numbers
BasicMediumLesson 3 of 12
- Good code explains what; comments explain why (business reason, workaround, link to ticket).
- Delete commented-out code — Git remembers it.
- Replace magic numbers/strings with named constants or enums:
if (age >= LegalDrivingAge). - XML doc comments (
///) for public APIs. - Enforce formatting with
.editorconfig+dotnet formatin CI so reviews don't argue about spaces.