3 ms·
That's the whole trick. Good code makes complex stuff look simple. Bad code makes simple stuff look complex.
by jacquesm 9y ago
That's the whole trick. Good code makes complex stuff look simple. Bad code makes simple stuff look complex.
- derefr 9y agoI wonder if you can formalize this. Assume TDD, and then measure the compressed size of the codebase vs. the compressed size of the test suite. Code is "worse" when it requires more "stuff" (informational entropy) to do less "stuff" (pass test cases.) The compression would presumably remove the redundancy of the language itself as a factor (including differences in idiomatic cyclomatic-complexity "depths" of various stdlibs), and also remove any redundancy in the way the test cases were specified. So it'd be down to a measure of how much circumlocution and over-engineering you did in the process of implementing the solution. I'd worry slightly that code-golf solutions would be rewarded, though. Maybe pass everything through an obfuscator + linter before computing the metric, so that things like identifier lengths and spaces aren't considered.
- aswanson 9y agoThat quote should be the metric by which code/languages are judged.