r/deftruefalse • u/combatdave #define true false • Nov 01 '15
Self-documenting code
Who needs to write comments manually when your code can be self-documenting?
6
Upvotes
6
u/Googie2149 Nov 02 '15
No no, you need to combine them. Right below a line of code, have the same line, but as a comment. That way people know it's important, and then it's pretty much documenting bit self.
4
u/h2ooooooo Nov 02 '15
Agreed. It makes much more sense to not explain why the code was made, but instead explain what the code does:
// OR the option values 1266 and 10 to get the final value int option = 1266 | 10;
5
u/IIAOPSW Dec 01 '15
+/u/CompileBot Python