sampledoc's Scientific Python Tools

Previous topic

Welcome to the Scientific Python Tools documentation for SAM

Next topic

Introduction

This Page

A Dialog on Python for Scientific ComputingΒΆ

Why should I learn Python?

If you consider the possibility that you will work in a different domain than
pure mathematics, then there is a good chance that you will need it at a given
moment of your career.

It is used in the industry?

Yes, it is used in many companies and by research institutions that use
computers as an instrument.

Why? I thought there is Java and C++ and so on...

With Python you can develop and prototype your products much more quickly. If
needed, parts of your production code can later be migrated to
C/C++/Fortran/Java or whatever.

Whatever?

Yes. One of the qualities that qualified Python to large industrial
application is its affinity to many programming languages. This makes it easy
to embed applications in both directions.

Aha, so you glue together tools.

Yes, Python is a perfect scripting language, but here I meant that you can
really mix programming languages in an easy and consistent way.

What is scripting?

Scripting is a way to let very different applications play together to
achieve your aim. This is another quality that makes Python attractive for the
industry.

What about research and scientific work?

As a researcher, you would like to know quite soon if your idea makes
sense. You would like to run simulations as soon as possible, so you want
quickly a correct prototype and not a prototype that runs quickly...

But that was one of the attractions of matlab, so what’s new?

If the idea works and the code gives you correct results, but you want it more
efficiently or you want to scope it to other codes or professional visualization
tools, then it is much simpler to migrate parts of python code than to re-write
the code from scratch, as usually happens with matlab projects.

I see. So with python I can glue applications together and can migrate critical numerical parts to C/Fortran. But if I do not need to? Isn’t matlab enough?

Enough? This is a good word!
It depends. Earlier I used to say: if you are satisfied with matlab and you do
not feel you need something more, then stay with matlab.

And now?

Now I would be more careful. I noticed that people prefer to use what they
learned first than to learn something new. This means that when people get a
difficult new problem, they make great efforts to solve it with the tools they
know better. This gives complicated solutions after great efforts, where
simple rush solutions were possible with new knowledge. You have to hit the
wall, and the hit must really hurt, in order to be really willing to learn
something new. I am sure that people are more efficient and more likely to
obtain good and rush solutions to hard problems if they learn python (and
scientific tools) first.

You mean that you can solve more difficult problems with python than with matlab?

I mean that with python et al you have better chances, especially for large projects.

Why should we learn or use python for teaching numerical methods? Isn’t it much too complex? Isn’t it simpler to use matlab for this aim?

When you start from zero, you need the same effort to learn matlab and Python.

matlab is a very good software. It has also its price, which is very high,
if you leave the university.  Most of our students will not remain in a
university, so working in a small company would be a clear handicap for
our alumni.

matlab is a good software because it was developed over several years under
very strict guidelines. Hence, it is more stable than the on-going development
versions of python et al.

For the very same reasons that make matlab very stable, matlab is very rigid.
Having to cope with the main ideas of 1970-80 makes improvements very hard
to realize. Object-orientation is the best example in this sense. It had to
be introduced in order to make matlab survive, but apart from its marketing
effect, it is useless, since it rather hampers than facilitates development
and code-reuse. Respecting old guidelines makes matlab strong, but rigid and
rather past-oriented. On the contrary, our students will live in the future,
let us give them a chance to make a better world!