3 ms·
When naming things you should name it what it is not what its for (call it a hammer not a nail driver) you can then make the determination of what you should/sh
by from-nibly 3y ago
When naming things you should name it what it is not what its for (call it a hammer not a nail driver) you can then make the determination of what you should/shouldn't do with it.
When writing comments, dont say what it does, say why its done that way. If the why doesnt need explination then it doesnt need comments.
Programming is theory building. Comments should only help you understand the theory not the source code. The source code is meant to help you know what the computer will do without interpretation. If you cant read the source code and know what it will do then you NEED to rewrite it. Otherwise just wtite it in assembly it will at least be faster that way.
Also dont include things that are learnable outside the context of your code. Dont explain what a state machine is in your comments. If you must, link to wikipedia or something.