Subject: Re: CCL:Object-oriented means for computational chemistry programming

From: Konrad Hinsen <[email-masked]>
Date: Fri, 11 Jul 1997 12:25:14 +0200

>   But, in a completely undefensible statement of preference: today, new
>     code should be built in C/C++ (IMHO).  I respect the fact that a huge

I don't disagree in principle, but a few clarifications can't hurt
(which are of course largely my personal opinion!):

- C is no more OO than Fortran, but it doesn't have most of Fortran's
  most severe problems. But Fortran-90 is no worse than C, and in some
  respects better.

- The main advantage of C is support: there is a C compiler for every
  imaginable machine, and there are plenty of high-quality libraries.
  But there is little support for numerical work, and indeed many C
  compilers are rather bad at optimizing standard numerical code.

- C++ is an exceedingly complicated language, largely due to its
  compatibility to C. It may seem simple at first, but the more
  you get into the details the more surprises you will find.
  Worse, there is a frightening number of "undefined" situations,
  meaning that the meaning of certain pieces of code is compiler
  dependent. Writing solid and portable C++ code requires a lot of
  experience. The payoff may be worth it for professional programmers,
  but most scientists are not professional programmers.

The bottom line: no single language is perfect. I think scientists
should get used to the idea of mixed-language programming. For
a small number-crunching subroutine the best choice may well be
Fortran, but for the majority of a non-trivial program it certainly
isn't. But all modern operating systems have provisions to link
code in different languages together.

Scientists should also have a closer look at high-level languages.
They make development and testing substantially easier by taking care
of much detail automatically. Of course that comes at a price in terms
of speed, but the majority of a typical scientific program is *not*
time-critical. The CPU intensive parts are specific subroutines that
can still be implemented in a low-level language.

My personal recommendation for a high-level language is Python. It is
sufficiently simple, has a clear syntax, and a very convenient
interface to low-level languages. For C code, a Python interface can
even be generated automatically with a tool called SWIG. More on
Python at http://www.python.org, and on my "Python for Science" page
at http://starship.skyport.net/crew/hinsen/. Finally, for those who
don't mind a trip to San Jose, the 6th International Python Conference
from 14-17 October in San Jose will have tutorials, presentations, and
discussions on scientific applications of Python.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: [email-masked]
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------