What's your favourite programming language and why?

It depends.

I'm a researcher in computer science, I'm quite old (52), and I've started programming before personal computers.

My mathematical interests and capabilities are quite low-level. Mostly elementary number theory and recreational math.

In the past I've tried several of the old languages, say Cobol, Fortran, Lisp, Basic, Forth, Prolog, Algol, Pascal, and that nutty case of APL. I also had to program in Java in its first years, and I did hate it.

But at the end, the two languages I use most of the times, say every day for work or for fun, are C and Mathematica, because they complement each other.

I use C because is very simple, very fast, and most of the times I just want to crunch integer numbers for days or weeks, so I need something very near the hardware. Sometimes I need some prêt-à-porter data structures so I use the Standard Template Library of C++, without actually knowing C++.

When I do not use C, I generally use Mathematica. I really like its functional paradigm and the fact that there are hundreds of very powerful functions already defined. But for basic things is quite slow, so if the code is simple I then code it in C after I tried the ideas with Mathematica. I tried the other main software for symbolic computation (Maple) and even if it is better than Mathematica in selected areas, I simply can't stand its syntax.

Then, I use a bit of Javascript, and bit of PHP for when I have to manage my websites. And a bit of Perl (which I learned a month ago...) when I have to manipulate textual files.

Since most of the functions I need I have already implemented in C, I've never felt the need to learn SAGE, but if I had to start from scratch maybe I would consider it.

At the end it depends on what kind of computation you are going to do more often. There are also program/languages like PARI (and a lot of others that I do not remember...) which are focused on certain aspects of mathematics.

/r/math Thread