Defects are not the fault of programmers
buttondown.email
buttondown.email
OTOH, if the required functionality is documented and it doesn't work, that is the programmer's fault.
> A lot of the nastiest bugs come from components that are all correct in isolation but interact in a dangerous way. This is called a Feature Interaction Bug.
IMO, the original programmers of those components are not at fault, but if someone uses those components together and doesn't verify that they're working as desired, that "someone" is at fault.
Sure, stricter discipline won't always help, but sometimes it will. Sometimes, the programmer really is just being lazy.
And I say this as a programmer.
- If the credit card transaction fails, do not ship the product to the customer, and notify the customer of the failure.
- Don't let the customer order more items than are available in our inventory, or zero items, or a negative or non-integer number of items.
- A web-based system should correctly handle multiple concurrent transactions.
- If something goes wrong, show the user a meaningful error message in their selected language, not a Python stack trace.
If my excuse for my code not doing this was "it wasn't in the spec", I'd expect people to ridicule me.
Or, take programming languages - is the null pointer "working as expected", or is it a "billion dollar mistake"?
That's pretty successful at getting the business/product people off the blame-assigning game and thinking productively towards resolving the interaction and defining a solution.
Edge cases are extremely rare. If they weren't they'd not be an edge case. But, we should still try and build robust systems and not allow the system to be in an unknown state. It isn't, "I have to think of all the possible cases." No, it's "These are the possible cases, nothing else is allowed."
If the cases were not specified, as you mention, then that is not completely a dev issue.
An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter. For example, a stereo speaker might noticeably distort audio when played at maximum volume, even in the absence of any other extreme setting or condition. [0]
A corner case (or pathological case) involves a problem or situation that occurs only outside of normal operating parameters—specifically one that manifests itself when multiple environmental variables or conditions are simultaneously at extreme levels, even though each parameter is within the specified range for that parameter. [1]
It's unhealthy, IMO. Instead, I prefer to focus forward on what to do next and how to avoid this particular issue again... and simply move on.
Blaming in the context of a situation is called "an excuse", and it's still defensive.
It's pretty nuanced after this though. If folk are defensive when a problem happens ("I don't know how this happened"="it wasn't me"), you have a blame culture.
So how does one figure out what happened without someone jumping on the blame-sword (or run screaming from it)? I haven't quite figured out the answer to that question, but one thing that helps is only ask what happened if it's truly a mystery that must be solved. If it was human error, quietly move on.
But you said "explain why we don't like Robert Martin", which to some extent says its a problem with the man himself, not his point of view on software defects. Starting your post that way undermines your conclusion and makes it seem as if you're post-hoc rationalizing your dislike of the mine rather than talking about software methods.
Now, I do tend to believe, that there still is a lot of low-hanging fruit with regards to programmer discipline. Many juniors (and some seniors) just straight up don't pay attention to things, don't check things, don't think things through to their obvious conclusion. You can then try to add policy to try to force them to do these things, like, e.g. you must have 100% coverage on your code, maybe that'll force them to try running their code at least once before merging into master. But then of course that must be a blanket policy for everyone, and you know how the story goes.
If the programmer is given an opportunity to evaluate the scope of the work and allowed to communicate the time they think it will take, then any fault in the resulting work is the fault of the programmer.
What I've seen are programmers unwilling to spend the time necessary to fully understand the work they are doing and managers/sales people/whohaveyou who push for aggressive timelines.
It's not that it's wrong. It's just really, really unproductive.
Rust language and community capitalized greatly on taking the opposite approach after years of stupid attitude like this present in systems languages community.
BTW. Uncle Bob has his opinions, good for him. They are not much more worth than anyone's else.
Right now customers are happy, but I expect some time in the next year someone is going to get a big fine because they didn't find the data they were supposed to and didn't realize it, and then they will no longer be happy.
- Abstractions - preventing bugs by having a proper language in which to express the ideas
- Assertions - making sure that certain assumptions are satisfied during the actual execution of the code, AKA defensive programming
And in particular, unit testing is IMHO a rather weak method of testing, compared to property-based or integration testing. There is this famous quote "bad programmers worry about the code, good programmers worry about the data". Similarly, I believe we should spend more time testing the assumptions that we have about data (can this value be 0?) rather than testing the logic of the code under the same and possibly wrong (or unstated) assumptions.
We could do this with software, but the world would look very, very different. We haven't had too many major destructive acts outside of privacy leaks, so there isn't pressure and resulting political will to regulate the industry, so economic pressures dominate what software looks like. Things like CSP headers are a distant, distant afterthought. People can't even keep their OSes, libraries, and runtimes current.
Plus software is harder to reason about than a building. Things can squeeze in or out through the smallest crack and nobody on the planet really knows whats going on in a modern cellphone or self-driving car top to bottom.
That said, I take responsibility for the security holes and bugs I create. There is no other way of being a professional software developer, even if it is hard.
Was it the last person to pull a piece out?
Maybe the person before, who barely managed to keep it upright?
Or is the tower doomed to fall by design?
Now, "behaving as specified", well, having clarity on that can often be a big problem. The dev. team does have some responsibility there as well because they should push for clarity instead of trying to interpret on their own. I've seen it many times: spec defines something in vague terms, dev implements it the way (s)he decides to interpret/imagine it without even asking for confirmation.
Issues can go beyond the dev team of course, but they cannot escape their responsibility.
I liked the post, so I filled out the newsletter signup form with my email. It immediately switched to show a credit card form to "Unlock full access" for $25/month. I was annoyed by this bait-and-switch, only to find that apparently it's all already accessible [1] and I received a confirmation email with a link to subscribe. So now I'm just confused.
Anyway, I disabled it. There is no paying-subscriber-only content and I don't plan to offer any in the near future. Sorry about that!
There's some archive posts[1] that are only for newsletter subscribers. Those are usually first drafts of blog posts I'm writing and don't want to be shareable yet. But that's just a newsletter subscription and totally free.
The utility you gain by believing or disbelieving a statement has no bearing on its truthfulness.
I don't think it's the case that we all have shared definition of exactly what "fault" means, leaving us only to deduce from that where the fault for defects lies.
So I don't think the maxim you stated is helpful here.
But the high level point of framing I think is very on point. You can only justify altering that which you measure, and if you only blame/measure/inspect the developer, you are missing stuff.
I mean do you want to be on this call? ... A: "One point seven million dung beetles can fit in my suitcase." B: "Let's get back to work." A: "Utility has no bearing on truthfulness."