Level 5: your work doesn't exist until it has been formally proven to be correct.
It's obvious that the amount of effort involved in this is so huge that it should only be considered in a select few problem domains. The same is true for the other levels. They're just a scale of increasing formalization/rigor, but you've said nothing to justify why they should be applied universally.
I think it's important to keep in mind that these levels (or something analogous) exist, but different domains have different sweet spots and a deliberate choice needs to be made for each project.
I think it's easy to judge from academia where you do an assignment, then move on to the next. But it only takes a couple of years in a real-world environment for code to get incredibly f'd up even if the developers were trying to be diligent. People come and go, platforms go out of style, programming fads come and go and, of course, one or two mediocre people on the team add their code to the mix.
Very insightful observation. Bad code is a problem that is both technical and social. Purely technical solutions won't cut it.
Consequently, business people don't trust us to do anything that resembles leadership. It's not just that they won't rely on us. They won't even let us take the time (which is why it's better to just do and ask for forgiveness, not permission) to do anything that involves future orientation or leadership.
The reality is that programming is a leadership role. When you write code and design systems, you will affect how other people work, unless your work is of such low quality that no one can use it.
The result of this is that we have a Greenspun's Tenth Law situation where the failure to address a capability results in it being met in an ad-hoc, ineffective way. Programmers aren't supposed to be multipliers, but such responsibilities emerge naturally and, when they do, the people picked to handle them (usually for political reasons, since business people are hopeless at evaluating software ability) are usually incapable of doing it.
Blog plug on this: http://michaelochurch.wordpress.com/2012/12/14/the-unbearabl...
Reasoning about your semantics and having the learning of the code be reified are certainly important. So then the question becomes how to incentivize helping that learnng
I think it does ruin the author's credibility. They didn't do the most basic research before including that code snippet, and are just holding it up as a distracting side show. The rest of the screed might have some value, but I'm pretty skeptical of that after reading the last paragraphs.
He follows this with a line of intentionally hard-to-read code.
Everyone who is familiar with Haskell knows that it's possible to write code like this, but it's not common. You have to actually work at it to make truly awful code in Haskell or ML.
That said, he's got a point, but the only solution he gives is "Include some comments!" I've seen so many shitty comments that I really think this is no advice at all.
Four levels of software maturity. (There are others. This is a simplified model.)
Level 1: Your work doesn't exist until it's in version control. It might be amazing to 2012-era programmers that this could be controversial, because even the laggards have reached L1 maturity, but at one time, it was. (See: the Joel test.)
Level 2: Your work doesn't exist until it has tests at multiple levels (e.g. unit and integration). Otherwise, it has no enforced semantics.
Level 3: Your work doesn't exist until it has well-documented semantics in addition to the tests, which cannot cover all cases. Otherwise, how does one even decide what a "bug" is?
Level 4: Your work doesn't exist until you've provided the resources (e.g. a code walk or an interactive module) to teach people how to use it.
If you're at Level 1, you won't lose source code. If you're at Level 2, your breakage rate will be reduced, and you can run CI. At Level 3, your system integrity will remain decent because you don't end up with those software-as-spec modules that, over time, corrupt the whole system.
Guess what? It takes Level 4 to get good code. Unless there is a culture of teaching (incremental code reviews are not enough) within the company, you will not have good code for very long. Since engineers are intolerant of context switches and in-person teaching doesn't scale, the teaching should be automatic. Interactive modules or, at the least, code walks should come with the technical asset being demonstrated. If people don't know what they are looking at, then how can they be expected to review or maintain code. With the worst code, it's not even clear why it's bad. It's just incomprehensible.