3 ms·
> How much does static analysis prevent you from creating bugs in the first place? In my experience, basically not at all. It might help you catch some bugs a
by mumblemumble 6y ago
> How much does static analysis prevent you from creating bugs in the first place?
In my experience, basically not at all. It might help you catch some bugs a bit sooner, but, outside of languages like C that have no guard rails to speak of, the bugs I've seen cause problems in production are rarely, if ever, the kinds of bugs that static analysis tools are even trying to look for. I am a big fan of linting, but it's primarily because I like anything that makes the code less surprising to future readers.
For a similar reason, I see the Java boilerplate as a maintenance liability because, while the IDE can write it for you, it's a readability burden. Future readers have to look at that boilerplate, recognize it as such, and then read more closely to make sure it is perfectly standard boilerplate before they actually know what the code is doing. And any small deviation creates uncertainty. Was that deviation intentional or was it a mistake? The thing is, boilerplate is boring, so nobody actually does that. In short, it's a classic example of the paradox of automation.