Discover your dream Career
For Recruiters
One quant has his say on the two languages

"Used properly, Python is not slower than C++"

When it comes to writing quick and effective code, it's a matter of programming concepts and of libraries, not of language. 

C++ is probably one of the "purest" object oriented language used by quants today. It's got a number of concepts like multiple inheritance that can be incredibly powerful. But I've seen people using it as a procedural language as well, and that's not really helpful.

Python is far from just a great prototyping language. Its key strength is its extensive and powerful libraries used for numerical and statistical calculations. For example, I can generate a VaR timeseries in but a single line.

As with C++, you can do horrible things to it - programmers from an IT background keep iterating over matrices instead of using vectorized functions. Used properly, it is not materially slower than C++.

Neither language comes without risks either. For Python it's a lack of strong typing whereas C++ has the unique capability of producing memory leaks.

What makes Python stand out to me however is the ability to use the same language throught the quantitative process, all the way from research to production. If I can get my hands on some top-notch C++ quants, great. If I have to choose between the risk of weak typing and IT guys recoding models in C++ without a clue what they are doing, I will choose weak typing any day.

Click here to create a profile on eFinancialCareers. Make yourself visible to recruiters and find a career in technology and finance.

Have a confidential story, tip, or comment you’d like to share? Contact: alex.mcmurray@efinancialcareers.com in the first instance. 

Bear with us if you leave a comment at the bottom of this article: all our comments are moderated by human beings. Sometimes these humans might be asleep, or away from their desks, so it may take a while for your comment to appear. Eventually it will – unless it’s offensive or libelous (in which case it won’t.)

Photo by cottonbro studio: https://www.pexels.com/photo/hands-typing-on-a-laptop-keyboard-5483149/

author-card-avatar
AUTHORChuck White Insider Comment
  • Tr
    TransonicShock
    10 January 2023

    I agree - I would add R in the mix as well. Part of what makes things fast is the ability to iterate over a lot of techniques. Both python and R offer a ton of libraries for this. Both have vector operations that are written in C/C++/Fortran. Both let you write snippets in those compiled languages if you really have some custom code that can't be vectorized using whatever is already available. They both serve as incredible glue languages. If I want statistical guarantees I would depend on R. If I want to extract features from raw data, I would depend on python. If there is some loop or function that really needs to be sped up, I can always use Rcpp or Boost.python. Similarly, I would expect any ds/quant to be able to write unix shell scripts, and use hundreds of already available tools that have been battle tested.


    Overall, language wars are dumb - people should have a menu of tools and pick up what they need to get the job done. These - X is better than Y, no Y is better than X blogs are pointless and just confuse newbies who are gullible.

  • To
    Tom London
    9 January 2023

    Thanks for copying my comment at https://www.efinancialcareers.co.uk/news/finance/python-vs-c - but maybe quoting the source...

Apply for jobs

Find thousands of jobs in financial services and technology by signing up to eFinancialCareers today.

Boost your career

Find thousands of job opportunities by signing up to eFinancialCareers today.
Recommended Jobs
Capstone Investment Advisors (UK) LLP
2023 Investment Graduate Rotation Program
Capstone Investment Advisors (UK) LLP
London, United Kingdom
Pearse Partners
Hedge Fund Equity L/S Analyst
Pearse Partners
London, United Kingdom
JK Barnes
Quantitative Researcher
JK Barnes
London, United Kingdom
Python Quantitative Developer
New York, United States
ParagonAlpha
Quantitative Macro Analyst
ParagonAlpha
London, United Kingdom