Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

– Martin Fowler

legacy-code-1I don’t think software gets the support or respect it deserves particularly in scientific computing. It is simply too important to treat it the way we do. It should be regarded as an essential professional contribution and supported as such. Software shouldn’t be a one-time investment either; it requires upkeep and constant rebuilding to be healthy. Too often we pay for the first version of the code then do everything else on the cheap. The code decays and ultimately is overcome by technical debt. The final danger with code is the loss of the knowledge basis for the code itself. Too much scientific software is “magic” code that no one understands. If no one understands the code, the code is probably dangerous to use.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

– Rich Cook

Recently I’ve taken to harping on deconstructing the value proposition for scientificUnknown-2computing. The connection to work of importance and value is essential to understand, and the lack of such understanding explains why our current trajectory is so problematic. Just to reiterate, the value of computing, or scientific computing is found in the real world. The real world is studied through the use of models in scientific computing that are most often differential equations. Using algorithms or methods we then solve these models. These models as interpreted by their solution methods or algorithms are expressed in computer code, which in turn runs on a computer.

Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?’

– Steve McConnell 

Each piece of this stream of activities is necessary and must be competently executed, but they are not equal. For example if the model is poor, no method can make up for this. No computer code can rescue it, and no amount of computer power can solve it in a way that is useful. On the other hand for some models or algorithms, no computer exists that is fast enough to solve the problem. The question is where are the problems today? Do we lack enough computer power to solve the current models? Or are the current models flawed, and the emphasis should be on improving them? In my opinion the key problems are caused by inadequate models first, and inefficient algorithms and methods second. Software, while important is the third most important aspect and the computers themselves are the least important aspect of scientific computing.moodys-software-bug-screws-investors2

With that said we do have significant issues with software, its quality, its engineering and its upkeep. Scientific software simply isn’t developed with nearly enough professionalism. Too much effort is placed on implementing algorithms compared to the effort in keeping the software up to date. Often software is written, but not maintained. Such maintenance is akin to issues with upkeep on roads and bridges. Often the money only exists to patch the existing road rather than redesign and rebuild it to meet current needs. In this way technical debt explodes and often overwhelms the utility of the computer implementation. It simply becomes legacy code. The code is passed down from generation to generation and ported to new computers. Performance suffers, understanding suffers and ultimately quality dies. In many places the entire software enterprise allows the code to be written then only maintained, and ported to generation after generation of computer.

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.

– Bjarne Stroustrup

article4More importantly software often outlives the people responsible for the intellectual capital represented in it. A real danger is the loss of expertise in what the software is actually doing. There is a specific and real danger in using software that isn’t understood. Many times the software is used as a library and not explicitly understood by the user. The software is treated as a storehouse of ideas, but if those ideas are not fully understood there is danger. It is important that the ideas in software be alive and fully comprehended. Unknown-4

Perhaps, the biggest problem we have is the insistence that the most important issue is the hardware; our computers simply aren’t fast enough. This is an overly simplistic view of the issues and ultimately saps energy from solving more important issues with software is among these. Unfortunately, it isn’t the weakest part of the chain of value, but it is too weak for the health of the field. In total the present National focus in computing is almost completely opposite to the value of the activities. The least valuable thing gets the most attention, and the most valuable thing gets the least. How things got so far out of whack is another story.

 People who are really serious about software should make their own hardware.

― Alan Kay