Subject: OOP in comp. chem.

From: [email-masked] (Ferenc Molnar)
Date: Wed, 9 Feb 94 12:10:23 +0100

Leif Laaksonen wrote:

>This is really a long time dream of mine. Just imagine if there would be
>more object oriented classes in computational chemistry code. You could
>just plug in and use a class for PM3, MP2, Leap-Frog algorithm and so on.
>All code would be easier reused. Today too much code is still developed
>for one particular approximation or application.
.
.
.
>I believe this is something we 
>quantum chemists have in front of us very soon. The whole consept
>has to be redefined. Perhaps this will never happen because there is
>so much "old" code available which will never be rewritten. But for
>the sake of science I wish this will happen. After all as Ron Shepard
>said we all appreciate more the kind of knowledge that remains useful
>for decades rather than months or years.

I agree with you, "something" has to happen.
The old code shold be rewritten and the concepts should be altered.
For example, a molecular dynamics program could be written 
very efficiently in the framework of an object oriented approach.
Atoms and molecules designed as class objects, interacting by some
virtual functions, would make it easy to add new types of features.
The whole thing could be done for example in C++ 
(don't say C++ is not OOP).

And as a bonus the administration of the code would be easier.

These were my ideas when I started the project I am currently
working on. But there are at least three drawbacks.

First:
You need quite a long time for designing your program in an OOP-language
when you are used to modular programming. 

Second:
FORTRAN 77 is the most portable language (C programmers forgive me!).

Third and most important:
As you always have a lack of hardware resources, you
need a compiler which optimizes efficiently.
Often the raw speed of your calculation is the crucial point.
FORTRAN compilers have quite a history and are very effective in
"number crunching" and are essentially bug free.
The advantage of C++ (or say FORTRAN 90) is that you can handle
dynamic memory allocations, but this can slow down the program and
prevent effective optimization.

And thus I decided (with considerable regrets) to use the hereditary 
style of programming for my project.

In my oppinion OOP methods should only be used for large scale projects.
These projects have to be supported by some organization like an
university or a company and are scheduled for years.
I think that in this case the financial grounds are there for even
reprogramming functioning code (e.g. Hyperchem from Hypecube).

I wonder if there are more such projects going on somwhere out there
and I would be very much interested in details.

Yours sincerely,

Ferenc Molnar

---------------------------------------------------------------------------
Institut fuer Physikalische und Theoretische Chemie
- Lehrstuhl Prof. Dick -                   Tel.:  (+49) 941 943-4466 /-4486
Universitaet Regensburg                    Fax.:  (+49) 941 943-4488
Universitaetsstrasse 31
D-93053 Regensburg
Deutschland / Germany
---------------------------------------------------------------------------
EMail (SMTP):  [email-masked]
               [email-masked]
               [email-masked]
---------------------------------------------------------------------------
:-) There is more to live than increasing its speed.
                                       -- Ghandi  ;-)
---------------------------------------------------------------------------