4 ms·
Sure, and then the next day the whole thing is just a long boring text which has no correlation to reality because the business rule changed and the developer n
by fogetti 8y ago
Sure, and then the next day the whole thing is just a long boring text which has no correlation to reality because the business rule changed and the developer next to you refactored the code.
- TeMPOraL 8y agoIf the developer next to you refactored the code without refactoring the comments, they did a shit job. Period. They need to be told to go back and fix it.
- fogetti 8y agoOr maybe the original developer who wrote the code which was so poorly written that it needed 4 paragraphs of explanation did a shitty job. Period. They need to be told to go back and fix it. You see! You argument works both ways, yay!
- TeMPOraL 8y agoOf course it does. If the comments are completely redundant with the code, they're bad. But you can't express as code why the some code is the way it is, and why it does what it does. After you tried to express in code every important information that's expressible as code, whatever important information remains must go into comments.
- fogetti 8y agoFalse dichotomy. You are trying to make this black or white while there are many more options beside comments. There are even obvious ones beside comments.
- AstralStorm 8y agoYou could. It is called an automated theorem prover, with the cheap limited version called constraint based programming. Sadly very unavailable for most programming languages. Sometimes writing the proof of why it should be like this is tricky, especially when complexity or performance is involved. (But then the tests are hard too.) Linters are essentially constraint systems for code, but not for the program.
- TeMPOraL 8y agoTheorem provers can still only talk about what the code does and whether or not it does it correctly. Specifying why the code is there is an AI-complete problem. Hence, comments.
- flowardnut 8y agoThis is one reason I like cucumber -- capture features in plain english, and also write tests to verify your plain english features actually work. It's an odd feeling, having the best of both worlds.