4 ms·
I really doubt there is any such consensus. Some people really care about superficial code quality (good variable names; short functions; consistent formatting
by gizmo 3y ago
I really doubt there is any such consensus. Some people really care about superficial code quality (good variable names; short functions; consistent formatting and documentation; compiles without warnings). Other programmers care mostly about architectural quality (shallow call stacks; correct data structures; few dependencies and little scaffolding).
- f1shy 3y agoAs stated in the previous comment, if you give code from group A to group B, they will tell you “I would prefer this and that, but still seems clean to me”
- gizmo 3y agoI don't agree. I know what the previous comment said. Modern C++ codebases that make extensive use of templates, inheritance, exceptions, type coercion, closures are considered clean by many because the code looks nice. But code like that can be a nightmare to work with, because of long compile times, spooky action at a distance, etc. Take these two files from LLVM: https://github.com/llvm/llvm-project/blob/main/libcxx/include/__compare/compare_strong_order_fallback.h https://github.com/llvm/llvm-project/blob/main/libcxx/includ... https://github.com/llvm/llvm-project/blob/main/libcxx/include/__algorithm/find_end.h https://github.com/llvm/llvm-project/blob/main/libcxx/includ... Is this "clean code"? I'm confident there will be absolutely no consensus.
- ecnahc515 3y agoIt depends on the language. Some languages are just poorly designed and make it really hard to write anything that’s clean without trade-offs.