12/25/2023 0 Comments Latest version writeitnow april 2016It focuses on Java developers, but is also useful for C# developers. This will help you clean up your code periodically and keep it clean.įor more information on Clean Code, I would highly recommend Robert C. In order to prevent this from happening, you should consider using the Tasks List to identify these TODO comments during code reviews. In fact, this feature has been around for several versions of Visual Studio.Ĭomments like these tend to accumulate over time, and become a part of your Technical Debt. Simply click View –> Task List from the menubar, then filter the results by “Comments”. Visual Studio even has a built in Task List viewer that can be filtered by “comments” so that you can quickly identify all your TODO comments. Many developers even follow a convention to prefix their TODO comments with a particular syntax. In reality, it’s not uncommon to find “TODO” comments sprinkled throughout application code, maybe even more so in legacy code. (b) write it later if it should be deferred (a) write it now if it needs to go in immediately If some code needs to be written, you can either: But what about adding reminders in your code? Sure, you should commit working code into your source control system and remove dead code. Another exception is the dreaded “TODO” comment and the technical debt that it causes. You should always write your code as if comments didn’t exist. This forces you to write your code in the simplest, plainest, most self-documenting way you can humanly come up with.”Īn exception to the “no comment” rule is when you have code that needs some explanation even after you’ve simplified the code as best as possible. “While comments are neither inherently good or bad, they are frequently used as a crutch. Jeff Atwood’s blog post from 2008 covers this: Over time, I’ve learned that comments should be used sparingly, and well-written code should reveal its intentions without requiring any comments. To stay consistent with the developers who had previously worked on the same code, I even added to the historical comments above each module.Īs a result, the top of a VB module could look like this: ' **************************************** When I first started out in software development, I used to write a lot of comments in my code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |