The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Why is C++ apparently standard for quants' software?

Is there such a need for superduper execution speed that I'm not aware of? Is it just standard inertia? I could see the need perhaps in real time trading systems that have to fill orders before the other guy does, but I don't see any real time requirements in quant software.

Any clues? Seems silly for such highly paid people to waste their time worrying about memory leaks and other low level stuff like that.
Steve Hirsch Send private email
Friday, October 06, 2006
I've wondered the same. C++ is awesome at micro-optimization, but is difficult and error prone to optimize at large system level (C++ code tends to be tightly coupled and brittle, especially micro-optimized code).

I think it partially because of all the legacy and expertise that's built up over the years makes it hard to unseat C++, even if other languages may be a better fit today.
Friday, October 06, 2006
Legacy issues - these were the people who needed the best when they started, but now they're stuck with the old best.

In a lot of cases hardware (storage, memory, processor speed) has outstripped old difficult problems, so the sensitivity to performance is not such a big issue.
Cade Roux Send private email
Friday, October 06, 2006
Just curious--anybody think there'd be a market for converting these C++ template/design patterns into PL/SQL?

Funny, I was interviewed by someone at Bloomberg, he asked me these really detailed C++ questions. Now, I had used it about 10 years go, so I could sort of answer them, but I failed the interview. Oh well.

The real question I had was, why in the world are they using C++ and dealing with Unix kernal issues?
Steve Hirsch Send private email
Friday, October 06, 2006
Temporarily accepting your fundamental assumption that C++ will be faster than some other language... I think the points about historical bias and legacy are important to consider. I'll address:

"I don't see any real time requirements in quant software."

What does quant software do?  Maybe you calculate the value of an option? maybe you calculate the value of an all the options, every strike price every expiration date, trading on all the the stocks in the S&P500?  Maybe you want to do these all day long so you can offer prices to customers or calcualte your PnL? 

You can see where speed would be nice in *some* quant sofware.
Friday, October 06, 2006
Steve. This isn't always the case. In shops where Quants have programmers write the code for them, their engines are in C++, but in shops where Quants told programmers to let the Quants somehow implement the internals of the engine, only the foundation of the engine (networking, etc.) is written in C++, while the working parts (analytics, calculations, etc), are written in scripting languages (usually proprietary scripting languages), which are easy enough for non-programmers to work with.

This is how it is in at least one IBank I know of.
Andrey Butov Send private email
Friday, October 06, 2006
Andrey, would it make sense to port these apps to, say, an Oracle database? If not, why not? Inquiring minds wanna know...

Also, Ed mentioned that there is some performance requirements in the crunching. With processors so fast these days, can these quant guys (as opposed to traders) wait 3 seconds instead of 2? Or are the times vastly different from what I'm thinking?

Thanks guys. I'm signing off for the holidays, will be back online Sun. evening.
Steve Hirsch Send private email
Friday, October 06, 2006
Simple (stupid?) answer: some things can wait 2 seconds, some can't. 

The quant stuff is often, you know, eventually to be traded.  So it just depends if it is a seconds matter business like automated market making or a seconds don't matter like generating some risk report that the regulators require on a quaterly basis.  generally fast is good, but the costs of being competitive with the very fastest players are v. high.

A database has a role to play, but implementing the whole quant platform on it? No.  The trend is more in the direction of less structured, less strongly typed languages rather than to the more typed, more structured area of SQL and relational dbs.
Friday, October 06, 2006
>> Any clues? Seems silly for such highly paid people to waste their time worrying about memory leaks and other low level stuff like that.

Uh, right.  Why don't they use a language like Java that has no memory leak issues?

And I'll take RAII any day over the typical Java finally/dispose nightmare for resource management (same applies for C#'s slight improvement over Java with 'using').
SomeBody Send private email
Friday, October 06, 2006
Do you actually pronounce the "u" in Quant?
English is my second language
Friday, October 06, 2006
I pronounce the 'u'. 'Quant' is short for 'quantitative' (or some variant), whose first syllable is pronounced like "kwan".
Mark Jeffcoat Send private email
Friday, October 06, 2006
I was listening to a Podcast by Marc Andreesson (Netscape) yesterday about the history and future of programming languages.

He said that Java opened up programming to a raft of people who couldn't do it before because C++ was too complex. He then went on to say that 10 years later Java is as bad if not worse than C++ because it has grown into this huge monster that is too big for mere mortals to grasp.

He then started pushing PHP as a killer language, which may have something to do with him getting a seat on the board at Zend recently. I haven't finished listening to the Podcast yet, but look forward to.

Me, well I'm a content C++ programmer.
Neville Franks Send private email
Friday, October 06, 2006
> PHP as a killer language,

You're kidding, aren't you? The only thing killed by the language might be my contenance ...

> Me, well I'm a content C++ programmer.

Same here :-)

Micha Send private email
Friday, October 06, 2006
Java was never that much easier than C

If you can't get c, then you'll probably never get Java either.

IMHO the only widely used programming language that people without the programming mindset could make a decent stab at, is BASIC, and eve then, especially the old kind of BASICs with line numbers and $ for strings.
Sunil Tanna
Friday, October 06, 2006
A lot of quants that I've dealt with use C++ to develop XLL's (DLL's for Excel) for their financial modeling.

Not only is the speed factor a major consideration but (I'm pretty sure) that C++ is the only language that can readily build an XLL in (VB doesn't cut it).

Also most of the libraries of financial functions (3rd party) are also developed in C++.
Marcus from Melbourne
Friday, October 06, 2006
I work for a company that deals with the stock market.  We are timed (by _our_ customers) down to sub-second performance metrics across thousands of calculations per second.  One app I worked on looked something like 3000 stock prices per second (we split most of the stocks on the major US markets across 3 servers).  That is probably what Bloomberg was doing as well.

Just to further emphasize the point, when a stock price changes from $100.00 to $100.01, they send a delta of the price across the wire since $.01 can be represented as a single byte rather than the two-four bytes needed to represent $100.01.  (That's a conceptual example). 

Even with all of that, major players are having major problems keeping up with increasing market rates.

I could be wrong, but I don't think Java or C# are up to it yet.
Saturday, October 07, 2006
Do Java or C# have a problem sending deltas?  Your post, while facinating, doesn't convince us why C# can handle the updates.
Ed C
Sunday, October 08, 2006
> Do Java or C# have a problem sending deltas? 

No. Given enough time, both Java and C# can send deltas.

Sunday, October 08, 2006
"Do you actually pronounce the "u" in Quant? "

It's usually the 'a' that's missing. Send private email
Sunday, October 08, 2006
OK, so apparently there's lots of signal processing going on. In that case, yes, you would want to optimize for speed. I don't think that that was what Bloomberg was doing, they were doing some text processing something or other.

I haven't put my finger on it, but something just doesn't seem right about it. Programmers working for quants are making big bucks themselves. And Excel? Still can't shake the feeling that it's just inertia (as my father did before me, so shall I do). Oh well.
Steve Hirsch Send private email
Sunday, October 08, 2006
There are several trading systems (both servers and frontends) used by both banks and exchanges developed in either C# or Java. I agree that most are still done in C++ or C, but anyone developing a trading system from scratch will look into these technologies.

I think speed is less of a problem, C# and Java is fast enough for most problems, the only problem is garbage collection, you don't want it to start at the wrong time, which for a server is all the time.

IBanks are generally slow to adopt new technologies so that is one reason why they stick to yesterday's programming environments, like C++.
Mellowman Send private email
Monday, October 09, 2006
If you spend all your time "worrying about memory leaks" in C++ then you're doing it wrong.

"Performance" is more than the number of microseconds spent in loops, in big programs it comes from resource management. Java, et. al. fail miserably in this respect.
Jimmy Jones
Tuesday, October 17, 2006
Another case for Quants is where, instead of doing a lot of simpler computations on a lot of assets, you are doing more complicated simulations on a more normal sized portfolio.  I'm not exactly a Quant, but the company I work for does some work where we have an interest-rate monte-carlo simulation.  We have between 250-1000 simulations of 23 rates of different terms, 360 months into the future, against which some thousands to ten of thousands of assets will generate monthly cashflows to be discounted.  That is a big bucket of data, and optimizations can for the worst of the runs make for the difference between hours and days.

I don't find memory leaks are a huge issue with experienced C++ devs, though invalid pointer derefrencing is still a pretty common bug.
Keith Wright Send private email
Wednesday, October 18, 2006
Why not use Better Hardware + Easier Programming Language ?

You can also add more features rapidly and Hardware is cheap.

BTW, what kind of hardware do they use ?
Am I Stupid ?
Friday, October 27, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz