Syracuse University, Fall 2002
PHY307/607:
Science and Computers
A comment on language choice
There are many useful and interesting computer languages out there, any
of which might be a good place to start scientific programming. More
traditional choices include FORTRAN, which is quite an old language that
was originally primitive, but has grown up some, and C, a quite useful
language to learn. Recently, people have been using C++ for scientific
programming and sometimes Java for teaching. These latter two languages are very
good to know, but are not the easiest place to start. Most people do not
learn python initially or use it for scientific programming.
Yet, I have chosen python. I think this makes sense for the following
reasons:
- It is easy to learn to write powerful code quickly, due to the
simplicity of the syntax, the lack of strict data types, and the
variety of available standard modules that do a lot of the work for you.
It is a very "high-level" language, so you don't get bogged down in
details.
- For mechanics in particular, available modules include Visual, a package written
for visualizing physical problems easily in three dimensions.
- Python is FREE, so you can all install it on your Windows or Linux
system, share with your friends, whatever.
- Python is "object-oriented" from the ground up. This teaches some good,
modern programming techniques from the start.
- Python is in common use as a utility language for computer systems, so
it is not a bad language to know for managing a system.
The disadvantages of using python for this course include the following:
- You will not learn about the data types and declaration of variables
that are important in languages like C, FORTRAN, or C++.
- Because of the lack of strong data types, large python codes are
potentially more prone to errors.
- As the community of python programmers is not as large as C or C++
programmers, there is less support for python users. (But less is needed to start.)
- Python is not the most efficient language on this planet. For our
use, that doesn't matter much and python can be extended with C modules,
making it very fast, if you put in the extra effort.
After a while, we will start using MATLAB to analyze and display data, as well.
This page maintained by A. Middleton. Last modified Aug. 24, 2002.