• VIEW THE 2025 QUANTNET RANKINGS.

Best Programming languages

  • Thread starter Thread starter SDass
  • Start date Start date
I've had some arguments about this point.

C++ specifically has the issue that it is so big with so many styles that it can be hard to understand. Suppose for example you are an beginning/intermediate C++ programmer thrown into the fire and asked to debug some legacy code. With C++, you could be dealing with any of the following

1. Advanced OOP code and corner cases like eg multiple inheritance
2. Advanced template programming (templates being almost Turing complete themselves).
3. FP (??? not sure on this myself as far as C++11).
4. Pointers.
5. Hand built GC.
6. Bad multithreading (especially when combined with pointer issues and exception handling).

Or from another perspective, all these features make it easy to write really messy code. See Linus's point here... http://article.gmane.org/gmane.comp.version-control.git/57918 (note, not saying I fully agree, but I was having an argument around this point).

My friend's counter-argument is that, given that C++ is like C with more stuff, it should be considered strictly better. So the tension here is really between the design for the beginning C++ programmer and the expert. I agree with him as far as C vs C++.

Actually my personal experience here is that even without these types of issues (ie, you inherited relatively clean code and can write it yourself), C++ has an awfully large amount of boilerplate. Note for comparison, I'd say that Python has a medium level of boilerplate, and say Lisp (the various kinds) and q have low boilerplate. Meaning you have to do ABCDEF to get to G instead of maybe just EF. That of course is also a strike against C. Really, this is what kills it for me when it comes to everyday tasks.

As for suitability, Python would be suitable for PDE and MC control code and HFT operations/research work. It just isn't suitable for core algorithms (and I don't think you'd get any argument there form any of us).
 
Can you be more specific on why C++ is not good for productivity? Some issues

1. OOP and GP and FP
2. libraries
3. Some example to prove or disprove your thesis (avoids rant that this thread is becoming).

Granted, 90's C++ was less flexible but now we have C++ 11 and Boost, for example.
Python would not be suitable for PDE, MC, algo or HFT IMO.

1) It takes time to be really productive in C++ and you will be spending more time in C++ than in doing real quant finance work. You can become productive with Python and R in relatively small time.

2) C++11 just landed. Boost is a great library but it's not easy to work with and if there is an error, God help us!! There is no comparison with the amount of existing libraries and packages for Python or R. BTW, if you want the cutting edge algorithm in statistics or machine learning for example, you can bet you will find it in R. You might be able to find it Python but there is no chance you will find it already implemented in C++.

From the things you mentioned, Python is not well suited for HFT just because sometimes you want such a level of raw speed that only bare metal helps (C++ is possible but FPGAs, GPUs, etc are making inroads). However, that's not real finance but computer/electrical engineering.

PDE, MC, low and medium frequency are great for python. If you want speed in those, there are plenty of options for speedups with little effort: Numba, NumbaPro, Cython and Theano come to mind. For a starting quant, I would recommend Python. If you have a need to get speed(after you have thoroughly profiled your code), you can implement your slow pieces in C++.
 
2) C++11 just landed. Boost is a great library but it's not easy to work with and if there is an error, God help us!!

I can't see the relevance of either of these two. Anyhow much of C++11 functionality was already in boost.

There is no comparison with the amount of existing libraries and packages for Python or R. BTW, if you want the cutting edge algorithm in statistics or machine learning for example, you can bet you will find it in R. You might be able to find it Python but there is no chance you will find it already implemented in C++.

But what language are the R algorithms written in? Surely, not R itself?

Like I said, I think it depends on what kind of "quant". Unfortunately, I've never had a quant job requiring cutting edge algorithms in statistics or machine learning.
 
2. Advanced template programming (templates being almost Turing complete themselves).

Which means - in layman's term - you can build anything with C++?
So you're saying (for the layman of course) that assembly language is just as powerful as C++?

My point there is that you have to learn another possibly whole language if somebody in your group decides to go crazy with templates. It is again, an expert vs beginner problem. Experts will find the extra flexibility great, as they have learned how to keep the the complexity that comes with it in check, but beginners will be really lost.
 
C# is a horrid language since it is tied so closely to a vendor. Look what's happening with Java.

What happened to Java?

edit: Java ownership changed hands, which is always a tricky one. It's cultural.
 
Boost is a great library but it's not easy to work with and if there is an error, God help us!!

Sounds a bit dramatic. Do you mean if you as developer make an error?
Boost is very easy to work with once you get the hang of it. But first you have to get the hang of it.

Boost is peer-reviewed and is thoroughly tested. I have used Boost a lot + written 2 books on it and I have found 1 show stopper in 1 library thus far.
 
How come most masters programs only focus on matlab, R and C++ while I have not seen any study plan that has a course on python? Would you say this study plans are out dated??
 
Matlab is going to die a horrible death at the hands of Python. R is so 'user-friendly' and toy-like that it will be used forever by sociology students and people in the medical profession who have no competence in programming. C++ will be around forever, but its will lose ground to Python et al. in certain applications.
 
How come most masters programs only focus on matlab, R and C++ while I have not seen any study plan that has a course on python? Would you say this study plans are out dated??

I think Python is the first language introduced at both CalTech and MIT. Speaking of which, John Guttag of MIT has a recent book out, titled "Introduction to Computation and Programming Using Python: Spring 2013 Edition," published by MIT Press, which I recommend.

What's happening on this thread is the older generation refusing to acknowledge that life has moved on and the Young Turks insisting that things have changed.
 
What's happening on this thread is the older generation refusing to acknowledge that life has moved on and the Young Turks insisting that things have changed.

That is correct. The thing about this is that most of this thread talks about what can be done in a particular programming language (and how practical it is). What I would like to know is what programming language is used the most in the industry right now. I only know R, Matab a little java and have set myself to learn C++ because in many trading platforms (TradingTechnologies, Quanthouse, OpenQuant, and the one of InteractiveBrokers) have API capabilities that use C++.
 
I think Python is the first language introduced at both CalTech and MIT. Speaking of which, John Guttag of MIT has a recent book out, titled "Introduction to Computation and Programming Using Python: Spring 2013 Edition," published by MIT Press, which I recommend.
It was Scheme at Caltech when I took the intro course. I know it has since changed (last 2-3 years) to Python.
 
That is correct. The thing about this is that most of this thread talks about what can be done in a particular programming language (and how practical it is). What I would like to know is what programming language is used the most in the industry right now. I only know R, Matab a little java and have set myself to learn C++ because in many trading platforms (TradingTechnologies, Quanthouse, OpenQuant, and the one of InteractiveBrokers) have API capabilities that use C++.

In my opinion as well, it's the wrong place to start. Barny's argument seems to be on target to me. Start with Python. In the last two or three years some phenomenally good books have been written on using Python for computation. The Guttag book is one, the Miller and Ranum one is another.
 
How come most masters programs only focus on matlab, R and C++ while I have not seen any study plan that has a course on python? Would you say this study plans are out dated??
It always takes time (> 10 years) before any new technology becomes mainstream (Java being the exception), caused mainly by 'entropy in the system'.

It is difficult to predict if a given programming language is future-proof if it has not yet reached a given critical mass.
 
Python is not a "new" technology anymore. It is over 10 years old. It is being embraced widely, by both software engineers and computational scientists (thanks for scipy/numpy and other excellent packages). It is clear you do not have much experience with Python, Daniel, so perhaps you ought to invest some time with it before forming an opinion.
 
Python is not a "new" technology anymore. It is over 10 years old. It is being embraced widely, by both software engineers and computational scientists (thanks for scipy/numpy and other excellent packages). It is clear you do not have much experience with Python, Daniel, so perhaps you ought to invest some time with it before forming an opinion.
I agree. I have not worked with Python yet, but 10 years is not a lot of time. Did you know that Guido van Rossum developed it in a weekend at the CWI Amsterdam?

It looks useful but novices will only need OOP and structured programming IMO. The other stuff takes > 10 years to appreciate (not a problem, just remarking).

Python is a multi-paradigm programming language: object-oriented programming and structured programming are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by metaprogramming[21] and by magic methods).[22] Many other paradigms are supported using extensions, including design by contract[23][24] and logic programming.[25]
 
C++ is huge.

So, what subset of the functionality of C++ can we use in order to make it as easy to use as Matlab or Python?

IMO, it's doable.
 
C++ is huge.

So, what subset of the functionality of C++ can we use in order to make it as easy to use as Matlab or Python?

IMO, it's doable.

You are missing the point. Even if you limit C++ to the python subset, it will not be as good as python for the tasks people use python for.

The whole point of python is rapid development. In C++ it takes you a day to write and debug a small class. In python you can do it in 10 minutes. God help you when you try and port your C++ code to a different machine/compiler too. Horrible, horrible portability.

If you do not care about the fact that your C++ code will run x times faster than your python code, then it is infinitely better at everything. In the modern day, the only excuse for using C++ is execution speed. Are people constrained more by execution speed, or by development speed, maintainability, re-use, portability etc? Very few applications that modern day programmers write need to be lightning fast.
 
Back
Top Bottom