• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Different programming languages and how they are used?

Joined
11/30/11
Messages
9
Points
13
Let me begin by saying that I have no programming experience and am currently working on my quantitative skills. I have only recently become aware of the 'quant' field and am just trying to learn as much about it as I can, so I posted this in the education section as it directly relates to the courses I will pursue.

I see a wide variety of languages tossed around in the quant vernacular. C++ seems to be the standard for most MFE programs... why? I have read that it is the fastest. I have also seen that MATLAB is commonly used for modeling, VBA is used mostly in non-quant, etc.

But what about the others? R, python, C, java, etc. What are their strengths and (financial) applications? I often see many job ads asking for skills in these areas, while it seems MFE programs strictly rely on C++.

I have seen some suggest you focus on one language, while others suggest you develop versatility. So with this post I am trying to see the practical applications of the latter.
 
each as their strengths, and varies by organizations. some organizations rely on MS products over Java. HFT usually go for C++. I'd suggest to study programming languages in general, or the hardest language IYHO, so that it'll be easier to pick up other languages along the way.
 
Firstly, I'll provide some advice for programming. Your best bet is to learn a language like Python first. Python is extremely versatile and will allow you to gain skills in basic programming concepts like branch/flow logic, variables, looping etc, while avoiding the trickier concepts of pointers/memory management which will be found in C++. It contains a wealth of "libraries" (i.e. extra plug-in components) to perform all sorts of tasks. It can also be installed easily on any platform and has an 'interactive shell' so you can just go ahead and start playing. In terms of resources, one of my favourite books on the subject is "Learning Python" - Lutz. It's currently in its 4th edition, I believe. You could also try the online courses at KhanAcademy and CodeCademy.

Having said that, C++ is the de facto language of quantitative finance. To say it is "the fastest" is slightly misleading as it almost always depends upon the domain of the problem. It is certainly -often- the fastest, but it is more complex than a language like Python as it allows you greater access to the underlying hardware of the computer. Many of the fastest algorithms in production environments to do with quant finance will be written in C++. It is a very deep language and can take a long time to master properly. However, if you would like to start learning, there are some great books available:

Teach yourself C++ in 24 hours - Liberty
C++: A Beginner's Guide - Schildt
Accelerated C++ - Koenig & Moo

R is mainly for statistical analysis and contains many libraries for specific statistics functions. It is rapidly gaining a lot of usage in finance. MATLAB was originally geared more for matrix problems and is highly optimised in this domain. It is great for rapidly producing models and also has a lot of usage.

As a real example, I worked at a fund where we made extensive use of C++, Python, MATLAB and Excel. C++/Python were used for data grabbing, storage and some processing (the slowest parts in Python were rewritten in C++), whereas MATLAB and Excel were used for statistical model generation and graphical output.

Hope that helps!
 
Python is a good place to start -- not only for the fundamental constructs of imperative languages but also as an introduction to OOP. The book by Lutz mentioned above is a great reference -- but not so good as a text to learn from. My favorite is Lambert's Fundamentals of Python: From First Programs through Data Structures. It's pricey but worth every cent. Another language to ease yourself into OOP is Ruby -- but there just seem to be fewer books on it than on Python.
 
I don't understand why everyone dislikes R when it has a very dedicated finance testing package (xts/zoo, quantstrat, PerformanceAnalytics, TTR, blotter, etc.).

The one issue is that R is slow on iteration, but Dirk Eddelbuttel (sp) is working on a fix for that which will speed it up during backtests.

The only thing R isn't great for is real-time production trading, but according to a HFT I talk with regularly, research quants and developers have different skill sets anyway.

(That said, in terms of Python, I passed Peter Norvig's Udacity course with highest distinction, as well as Sebastian Thrun's self-driving cars (which just got legalized in California) courses, both of which used Python). Peter Norvig's was especially difficult, but I got through it.
 
I think the best is to avoid those kind of debates about "which is the best/most useful" language. A good programmer understand the specificities of each language and their limitations. So the best would be to learn and try as much as possible.
Working with C++ and Java (for instance) would let you understand why pointers are useful, when we should use references instead, etc.
Learning a functional programming language could teach you the importance of referential transparency and why the keyword "const" is not optional in C++.

As you learn new languages, you will get better at those you already know.
 
Back
Top