Leave the code better than you found
Khem Raj February 10, 2025 #metaOften, we work on existing codebases more than writing complete new software from scratch. While implementing new features or fixing defects, we come across places with
TO-DO
Typos
Ambiguous comment
logical error
You can ignore it and continue with what you are supposed to do. Side-step it if it comes in your way and build logic around it, however, if you do that, you might have come close to improve the quality of code.
It is good to open a tracker defect and even better to fix it
"While here fix XYZ ...."
Modern SCMs like git have concept of change sets, where you can create independent commit for this particular change and yet propose it as part of change set meant for what you are working on.
It effectively reduces technical debt.
Leave things better than you found it is a good practice to build in teams with a bit of assume responsibility a lot can be achieved.