by tbrownaw · 2y ago · 0 comments
I've seen real code that looks like
if(bool_var == false) {
other_bool_field = true;
} else if(bool_var == true) {
other_bool_field = false;
}
Which I suppose could be called anti-concise.There's a basic level of concision you'll have by default if you actually understand the problem and the tools. You won't go away out of the way to complicate things. Maybe it's still a far cry from optimal, and definitely not code golf, but enough that I'd be worried if I saw even a first draft without it.
The risk is that you may end with such concise code that nobody understands what it does. I went that dark path with perl 20 years ago, form "oh what a cool language for someone who comes from C" to "let's squeeze that in half a line, and either do no understand what it does, or add three lines of comments to explain".
But yes, there is a good middle-groud somewhere