3 ms·
I hate to disagree but that's fairly clean code. It's not doing anything tricky or exceedingly clever, so the code speaks for itself. They're even polite enough
by Cieplak 9y ago
I hate to disagree but that's fairly clean code. It's not doing anything tricky or exceedingly clever, so the code speaks for itself. They're even polite enough to separate their implementation from their interface, which is rare for projects in dynamic languages. It reads like idiomatic, OO, pep8'd python. Python is basically executable pseudocode as it is, provided the method names and parameters convey the semantics of the code.
https://github.com/facebookresearch/end-to-end-negotiator/blob/master/src/agent.py https://github.com/facebookresearch/end-to-end-negotiator/bl...
- stubish 9y agoThe code speaks for itself, so there is no way to confirm it works as intended. Because the intention is undocumented. The code tells what the program does. The comments should state what it is supposed to be doing and why it should do it. When they don't match you have found a bug.
- DigitalJack 9y ago“Code never lies. Comments sometimes do.” I forget who that quote is attributed to.
- herbst 9y agoPretty sure that is what unit testing is for. No excuse for wasting time on comments