5 ms·
> Now, if you want to suggest that tools can add enough value to overcome the negatives from having rubbish programmers, I'm all ears, because I've never seen a
by Ace17 9y ago
> Now, if you want to suggest that tools can add enough value to overcome the negatives from having rubbish programmers, I'm all ears, because I've never seen a tool that can do that. The bad programmers just abuse the tools or ignore them.
So much this.
This perfectly matches my experience (and desperation).
Bad programmers will do their best to work around tool-imposed limitations that they don't understand. And these workarounds will generally increase code complexity!
- Force a minimum coverage ratio: they will create useless tests that don't check anything (without assertions).
- Force a maximum on function sizes: they will split their methods halfway and pass the whole local state through parameters.
- Force a "no-global variable" policy: they will create singleton classes.
- Force a "no public member variable" policy: they will create set/get methods for their private members.
I'm not advocating for any of the above restrictions, they do more harm than good.
Please, give me something I can put into my CI server that checks for bad coding practises, something that checks that the code stays SIMPLE.
Fact: you can inject a new disabled feature into a C codebase with zero risk of introducing any bug ... by wrapping your 50 modifications of the codebase into #if/#endif clauses.
Guess what? This will make the code a lot more complex, will slow down every developer, and will increase the likelihood that they create bugs in other features.
Finding bugs is only the tip of the iceberg. What I want is to decrease the probability of their apparition, by keeping the code simple.
Bugs and code complexity are correlated. Only targetting bugs will break this correlation, and we will be left with correct rigid code (very hard to modify).
Even if my compiler perfectly prevents me from breaking anything, I still want to be able to add a feature in a reasonnable time.
Let me summon Rich Hickey here: Simplicity Matters, and "nobody drives on the highway by bumping into the guard rails".