Friday, April 13, 2007

Impressions

There are so many NMR programs in circulation that I am forced to admit that creating a bad NMR program is easy. With one single, outstanding and obvious exception, however, no existing program satisfies me, so I conclude that writing a _good_ NMR program is very difficult. In my first two sentences I have already implicitely mentioned one of the extrinsic reasons. Any new program has to fight against a multitude of historical competitors that are normally crappy but can count, nonetheless, on a faithful users' base. Users resist to changes, don't want to learn anything new, don't like to spend money. I personally prefer spending my money on software rather than on hardware, because the former lasts many years and has no negative impact on our environment, but most of the people I know have never purchased a software product in a lifetime, including somebody who buys a new PC every other year.
While the software industry has discovered the importance of the WOW factor, there are many spectroscopists who believe the WOW factor is evil. They don't want their working tool to look like a toy, they need the protection of a difficulty barrier that separates men from children. When a program becomes too elegant and too simple they feel they are losing the control of what really happens underneath.
For the historical software makers the wow factor is terribly difficult to achieve. They have tons of old code that's been recycled hundreds of times. Who wrote the code twenty years ago doesn't work at the company anymore and nobody else can adapt it to new needs or optimize it for the modern hardware. What I like the most is to interact with spectra in real time. The requisite is to have fast algorithms. In many cases it is necessary to break the old algorithm in pieces and mix them with new instructions that allow for interactivity. The major makers simply rewrite the user interface on top of their historical code, they change the clothes, cannot change the substance.
A fitting example is Topspin. It does not allow the user to interactively correct the phase of a 2D spectrum. This is really huge. It's not the only limit. Last year I asked Bruker if anti-aliasing was implemented and they admitted they had heard about such a thing, but it was not feasible. I really wonder why other people like Topspin so much. Probably it's because it still responds to the venerated "zg" command. Bruker worked hard to insure backward compatibility (and had no choice about it). Incidentally, this is another reason why it's so difficult to write an NMR program.
Even those who are brave enough to rewrite a program from scratch (and free from backward compatibility issues) don't know where to start from. Users expect a modern NMR program to perform so many different tasks. It's not by chance that small applications, perform a single task, are elegant and do it wonderfully. It's terribly complicated to unify under a single project the so many disparate tasks of NMR spectroscopy. Just think at drawing 1D, 2D and 3D spectra with the same program, and this is only the beginning... A word processor isn't simpler to write: the problems to solve are comparable, but the public is wider, so much more resources are invested.
I have beaten enough around the bush. Let me come to the main point. Many recipes can create a wow factor, but only one never fails. For a program to never stop impressing me, its reaction time must be zero. With today's double core processors this is feasible, but requires both ingenuity and hard work. To exploit every ounce of power you should split every task in two or four processes, and assign one at each available core. To achieve top performance the compiled code should also be light and short. Even with today's cheap RAM, this is still a requirement. The general trend is the opposite: mainly they try to reduce the cost of making software, interpreted programs are preferred to compiled ones, general purposes (and bulky) libraries are preferred to the practice of writing specialized code.
The good news is that there is still people who enjoy writing their own code and optimizing it.

0 Comments:

Post a Comment

<< Home