Subject: CCL:programming language

From: Keith Refson <[email-masked]>
Date: Mon, 5 Feb 2001 10:08:02 +0000

Don Steiger writes:
 > This may be true about FORTRAN77 but it is definitely not true about
 > FORTRAN90/95.  The handling of global data and the dynamic manipulation of
 > array size is at least as good in FORTRAN90/95 as it is in C/C++.  

Indeed, the new Fortran standard offers all that is necessary for
high-quality scientific programming.  However it is equally true that
so does the new C standard, C99.  (restricted pointers,  true dynamic
arrays including multidimensional, complex data types and
arithmetic).  I don't believe compilers for C99 are widely available
yet, but it seems to me that both languages are highly suitable and
widely used in scientific programs.

 > The only reason not to use FORTRAN90/95 in large numerical
 > simulations is that it will soon become extinct because nobody is
 > using it.

This is a highly contentious opinion and the complete opposite of my
experience.   Almost all of the large scientific Fortran  programs I
am familiar with do not compile under an F77 (+extensions) compiler.
Even old codes which are undergoing development are using the new
Fortran features.

In any event, the poster enquired about what is the best language to
*teach*, not the best for scientific programming.  
In my opinion you should be teaching *programming* not a particular
language.  Your students will probably not be aware of the distinction
initially, but hopefully will by the end of the course.

In my opinion C is a poor choice for a teaching language.  Though it
is powerful, it's design philosophy makes it too easy to shoot
yourself in the foot ("if it stopped you from doing stupid things,
that would prevent you from doing clever things too").  Your students
would waste too much time wrestling with C-specific pitfalls, which
would detract from their education in programming.

A good choice is "F" which is a subset of Fortran 95, ie Fortran with
the crufty old parts of Fortran 77 such as equivalence removed, thus
removing much of Fortran's vertical ammunition trajectory potential.
It is a complete and powerful subset and a great introduction to full
Fortran and  there are free compilers available.

Avoid Visual Basic -- it's the computing equivalent of flipping burgers
in McDonalds - only the lowest level grunt jobs want VB.

Another approach is to avoid 3G languages altogether.  We teach our
undergrads using Matlab, which enables them to get to grips with
high-level concepts, use robust numerical libraries and graphical
output without worrying about the bookkeeping aspects of 3G
languages.  It's a good way of packing a lot into a short course.

Keith Refson
-- 
Dr Keith Refson,        "Paradigm is a word too often used by those who would
Dept of Earth Sciences      like to have a new idea but cannot think of one." 
Parks Road,                  -- Mervyn King, Deputy Governor, Bank of England
Oxford OX1 3PR, UK        
Keith.Refson@                       Tel: 01865 272026
             earth.ox.ac.uk         Fax: 01865 272072

---

From: Richard Gillilan <[email-masked]>
Date: Mon, 05 Feb 2001 12:17:16 -0500

> languages.  It's a good way of packing a lot into a short course.

Matlab is great, and at least as easy as FORTRAN.  I believe it is the main language taught to
Engineers here at Cornell. Also used heavily in financial engineering and extensively for teaching
and research in nerobiology (electronics interfacing course). Now that I think about it, I would probably
recommend Matlab over Java, Python or Perl for a student starting out. If nothing else, students will
continue to find it useful for general plotting and data analysis, though it is capable of the most
advanced numerical computations. There is a free Matlab clone
called Octave. The commercial Matlab is a bit expensive if you don't have some kind of
Campus-wide deal. A limited educational Matlab version exists for cheap, but the array limits
are severe.

Richard Gillilan
Cornell