4 ms·
Write comments that explain why a certain line is there. Let's say you are parsing a standard tab delimited file. You find that the tab delimited file has some
by daemonk 12y ago
Write comments that explain why a certain line is there.
Let's say you are parsing a standard tab delimited file. You find that the tab delimited file has some non-standard features, so you have to write some extra lines of code to handle it. For people who thinks the code just parses a standard tab delimited file, these lines will be confusing, so you comment these lines and say why you included them.
- auxbuss 12y agoOr create a function to handle that case, name it appropriately, and call it. Thus, no comment is required. You can also test the additional method in isolation, if you wish. I appreciate that this type of thing is language dependent.