3 ms·
> Clever code is probably the worst code you could write But you should write it anyways. Preferably in a situation of little consequence (school, personal pro
by GuB-42 2y ago
> Clever code is probably the worst code you could write
But you should write it anyways. Preferably in a situation of little consequence (school, personal projects, prototyping, etc...)
Otherwise, how do you make the difference between code that is simple and code that is just dumb?
"not clever" code typically has: copy-pasting, no abstractions, hardcoded values, global variables, cascading "if"s... And sometimes, it is the right thing to do, but good, readable code is usually a bit more clever than that.
But how do you know the right kind of cleverness? For me, the best way is to experiment. Sometimes, trying to be clever fails, sometimes, it really makes your code better, but if you don't try, your code will never get better.