I don’t blame the people writing the code. I blame management.
But to your point: If there is such a thing as a bug-free, complex software system, I have never seen it. High availability systems are not built by reducing bugs to zero. They’re built by expecting and handling errors properly, including faulty inputs — among them, the specification itself. 80% of public bugs on GitHub are specification errors, meaning the code was OK, the spec it was coded to was wrong or incomplete.
All experienced developers should be aware that specifications are often wrong, and there should be systems developers can employ to get specification errors corrected — especially on life critical systems!
In the case of MCAS, it should have been obvious that a single sensor can fail and trigger incorrect nose down commands. The system should have been designed with input error checking, and the developers should have been able to spot the problem and help get it corrected, if a proper quality process was being followed and developers were not feeling rushed.
The fact that there were failures at multiple layers here, combined with reports from software engineers who worked on the 737 Max 8 software is evidence that management let the wrong engineering culture emerge on this project.