Why I think Java will take the lead over C++

btw the resources for C# alone are a multiple times larger than for Java, whether open source, or proprietary. Can you show us a few JAVA proprietary charting libraries that come even remotely close to what you can do with WPF (universality such as DevExpress vs Specialized high performance such as SciChart)? I am curious. How about support websites? Check out the number questions asked about Java vs C# at the world's largest coding website, StackOverflow.

By the way up-to-date performance tests in well written C# code pretty much blow away Java in each and every category. Good luck though with your weird and totally opinionated, from reality removed, statements.



With a background primarily in software engineering and living in Java I just don't see a strong future for C++ as the primary language for developing trading systems. The argument a few years ago held true that performance was faster with native code which C++ compiles into but if you look at the industry and where Java is headed here are my major points for seeing this shift: This also holds true I think with Java vs. Microsoft.NET

1. The huge amount of open source frameworks built in Java that are available for free when building systems is incredible. This ranges from generic to trading specific frameworks like FIX integration. So you get a head start and faster development time in Java vs. C++

2. Java performance keeps getting better its easier to code in java, it abstracts memory management from the user which is a big advantage in not having to deal with memory leaks. If you compare raw computing between java and C++ it’s very minimal. Its also easier to maintain and understand existing code in Java than C++.

3. The tooling for java and the tooling that can be built for domain specific languages for building trading strategies are feasible (which is what I have done) in java and you can even embed other higher level languages on the java platform unlike C++.

4. It’s easier to build distributed systems with java using higher level networking frameworks and with the ability to build distributed systems like I do for tick processing that would take a long time to build in C++. I can process over 70 million trades per session using multiple servers all in real time with java.

5. Look at the developer market, you have more developers that are really good in Java than C++ and I think the old school thought that trading systems should be built in C++ is going to fade. The one exception might be ultra ultra low latency order execution but we are talking less than milliseconds of difference and in my experience people building systems the order submission time assuming you’re in a good data center is extremely fast with the brokers I have experience with.

Just my two cents would be interested if people agree or disagree. - WaveTrader007
 
Last edited:
and for good reason, the constant compiler optimizations and improvements in the .Net stack make it the one of the fastest OOP languages, running circles around some Java code. Have you tried to write fully async/multi threaded code in .Net, nothing is simpler and yet so performant.

I think microsoft realized the basic gist of your discussion, and therefore implemented .NET framework into their languages. I've been reading and hearing C#.NET is actually what will become the front running language in the C family
 
wow, wow and wow. That I would ever hear C# praises from your mouth, I am flabbergasted
;-)

Hard to admit but .NET is becoming real challenge for all others on IDE side and available resources and most importantly program performance.

It looks like C# will finally succeed as main programming language for Windows platform.

The only problem is that many programmers were burnt in the past by staying loyal with Microsoft. However, Microsoft is no longer monopoly as it was before and they are more programmer friendly and really good - they still know some things about Wintel hardware/windows that others do not and that gives them an advantage.

For non windows based applications it will have to be Java; or C\C++ for those procedural programmers who have good understanding of inner workings of hardware/operating systems and can use Object oriented features simplifying complex appliication building or want to branch into GPU programming etc.
 
100% agree. We had similar threads many times on this site, and each and every time it turned out that the open source, free here, free there, were the ones who claimed C#/.Net was the worst ever invented and most often the reason given was that MS dared to charge money for its IDE. Lol, so there you go, sometimes reasons for like and dislike can be rooted in very obscure beginnings.

To whinge about IDE licensing costs admits that your code will not be worth that cost. If that's the case, it sucks to be you.

The memory management argument is a ruse. GCs stop everything and their timing is unknowable. So, your real-time trading system will PAUSE from time to time, to release out of scope objects. That's a bit of a pisser when you're sending orders to market, and want to hit the price you see right now. Sorry, bad fill, was doing a GC. Tell that the the head of desk & see if you last the day...

Grow up and learn C++. Punch that hippie who taught you Java.

Even then, if Java's still your thing, then hey, enjoy the open source culture, spend your weekends contributing to some framework for $0, dream about scrum, kanban, extreme programming, and whatever other micromanagement tools you skateboarders dream up. Go get drunk with the other back office wannabes. Whatever. Get a side job teaching Java to other failed programmers ;o)

Too harsh? Critique it.
 
100% agree. We had similar threads many times on this site, and each and every time it turned out that the open source, free here, free there, were the ones who claimed C#/.Net was the worst ever invented and most often the reason given was that MS dared to charge money for its IDE. Lol, so there you go, sometimes reasons for like and dislike can be rooted in very obscure beginnings.

Without getting into the language flamewar (again), I want to point out that, while usually the maxim 'you get what you pay for' holds true, open source ('free') software has actually been an extremely successful model for distributing and maintaining software, and it is not the realm of 'skateboard hippie programmers'.

It is kind of counter intuitive. But my hypothesis is that being able to build off of others' infrastructure in the software world is so powerful that communities that follow the open source model do in fact Get Stuff Done. Let me stress that I'm not bashing proprietary software and a lot of times the proprietary model makes sense. But open source software also works well, and large successful corporations like Intel, Twitter, Facebook, Apple, Google all use plenty of open source software and contribute substantially to the open source community. In fact Linux is mostly maintained by corporate employees (cf. http://www.extremetech.com/computin...-develops-linux-the-answer-might-surprise-you). Many, many technologies started life as closed source projects and were released as open source when the owners decided the cost of maintenance and development would be lower as an open source project. Examples include OpenJDK (the standard Java platform), Darwin (which OS X and iOS are based on) and many others.

-----------------------------------------------------------------------------------

Also the standard tagline "GC is for dummies, it invariably results in stop the world crap and you lose predictability" -- largely is true, but you can never escape non determinism. Like once you get rid of stop the world GC (usually by reimplementing in C++), you need to start worrying about when a call to free() is going to trigger a walk of the free list. Or when the scheduler is going to kick you off the next slice. Or when the CPU triggers some random interrupt. Or what the latency of serializing a packet header will be when a router you don't even own is clogged. All of these things contribute to non-determinism at different points in the system, and GC is just one of the more obvious. As a system designer you need to figure out what the constraints your system must adhere to and code to that. If you are worried about millisecond or even microsecond level jitter then if you are a sufficiently talented programmer you can pull it off. If you are worried about nanosecond jitter then you either have deep pockets or are facing an impossible project.

Frankly, these days I am worried less about any particular performance constraint and more about correctness, being able to quickly write correct code is the way to get to the top. Fast code is useless if it fails, just look at Knight. Plus it takes so much longer to write. If you need more performance, it's easier to either buy a faster computer/cluster/supercomputer or literally to just write a fucking compiler (aka code generator) to output the code that meets your performance specifications than to hand optimize and verify each line. So in my current worldview the best language is the one that has better codegen / correctness proving / productivity facilities than a better runtime. (Java and C++ both fail quite miserably in this regard, unfortunately).
 
I was not the one who used the term 'skateboard hippie programmers'. And my criticism towards the arguments used by those who take issue with Microsoft was not targeting the use of open source software but their hatred towards anything made by Microsoft. My point was that it is tiring to constantly hear people moan about the fact that proprietary software costs money. Just because some chose the route to go open source does not mean everyone has to hand out freebies (I am aware most open source licenses are anything but freebies).

I disagree with your GC comment though: I run a platform which core is entirely based on C# (some hooks into APIs are coded in C++) and my platform has been running very stable for years now. I am not dependent on microsecond executions and latencies and even a platform entirely written in C++ does not escape non determinism simply because an event based architecture is non deterministic by definition, not to even mention incalculable CPU triggers or cache misses, unforeseen latency in the network stack or the like. Not a million unit tests will cover every combination of events that can occur at once. My point here is that every language and every implementation presents uncountable potential points of failure. Handling potential errors, even when the exact error cannot be predicted, is what sets an excellent developer apart from the pack. Whole books can be written about error handling. But suggesting GC on average results in "stop the world crap" is a quite bit undeserved imho, to put it mildly. If I had to put a wager on either a failure of GC or a bug due to the improper handling of memory by a C++ coder then surely my money will be on the C++ coder failing. You may not agree with the last line but I sense that we broadly agree on not ranking languages but rather the quality of implementations.

Regarding your last line I full heartedly agree. In the department of writing correct code fast I think C# is pretty high up on the list (but then again we are talking about language rankings).




Without getting into the language flamewar (again), I want to point out that, while usually the maxim 'you get what you pay for' holds true, open source ('free') software has actually been an extremely successful model for distributing and maintaining software, and it is not the realm of 'skateboard hippie programmers'.

It is kind of counter intuitive. But my hypothesis is that being able to build off of others' infrastructure in the software world is so powerful that communities that follow the open source model do in fact Get Stuff Done. Let me stress that I'm not bashing proprietary software and a lot of times the proprietary model makes sense. But open source software also works well, and large successful corporations like Intel, Twitter, Facebook, Apple, Google all use plenty of open source software and contribute substantially to the open source community. In fact Linux is mostly maintained by corporate employees (cf. http://www.extremetech.com/computin...-develops-linux-the-answer-might-surprise-you). Many, many technologies started life as closed source projects and were released as open source when the owners decided the cost of maintenance and development would be lower as an open source project. Examples include OpenJDK (the standard Java platform), Darwin (which OS X and iOS are based on) and many others.

-----------------------------------------------------------------------------------

Also the standard tagline "GC is for dummies, it invariably results in stop the world crap and you lose predictability" -- largely is true, but you can never escape non determinism. Like once you get rid of stop the world GC (usually by reimplementing in C++), you need to start worrying about when a call to free() is going to trigger a walk of the free list. Or when the scheduler is going to kick you off the next slice. Or when the CPU triggers some random interrupt. Or what the latency of serializing a packet header will be when a router you don't even own is clogged. All of these things contribute to non-determinism at different points in the system, and GC is just one of the more obvious. As a system designer you need to figure out what the constraints your system must adhere to and code to that. If you are worried about millisecond or even microsecond level jitter then if you are a sufficiently talented programmer you can pull it off. If you are worried about nanosecond jitter then you either have deep pockets or are facing an impossible project.

Frankly, these days I am worried less about any particular performance constraint and more about correctness, being able to quickly write correct code is the way to get to the top. Fast code is useless if it fails, just look at Knight. Plus it takes so much longer to write. If you need more performance, it's easier to either buy a faster computer/cluster/supercomputer or literally to just write a fucking compiler (aka code generator) to output the code that meets your performance specifications than to hand optimize and verify each line. So in my current worldview the best language is the one that has better codegen / correctness proving / productivity facilities than a better runtime. (Java and C++ both fail quite miserably in this regard, unfortunately).
 
I disagree with your GC comment though: I run a platform which core is entirely based on C# (some hooks into APIs are coded in C++) and my platform has been running very stable for years now. I am not dependent on microsecond executions and latencies and even a platform entirely written in C++ does not escape non determinism simply because an event based architecture is non deterministic by definition, not to even mention incalculable CPU triggers or cache misses, unforeseen latency in the network stack or the like. Not a million unit tests will cover every combination of events that can occur at once. My point here is that every language and every implementation presents uncountable potential points of failure. Handling potential errors, even when the exact error cannot be predicted, is what sets an excellent developer apart from the pack. Whole books can be written about error handling. But suggesting GC on average results in "stop the world crap" is a quite bit undeserved imho, to put it mildly. If I had to put a wager on either a failure of GC or a bug due to the improper handling of memory by a C++ coder then surely my money will be on the C++ coder failing. You may not agree with the last line but I sense that we broadly agree on not ranking languages but rather the quality of implementations.

Regarding your last line I full heartedly agree. In the department of writing correct code fast I think C# is pretty high up on the list (but then again we are talking about language rankings).

Yes, I agree. I think we are actually saying similar things, that GC is just one of a million possible 'bugs' -- in certain contexts a stop the world collection is a bug and in others it is not, but the point is there isn't any language or platform which will save you from yourself ;).

Also I haven't written any C# myself but it looks quite nice. If you are interested, check out D as well, it offers low level memory management, some nice template facilities as well as many features from more modern languages like C#. The drawback is it is not popular (yet?) so the libraries and tools tend to be lower quality. Not sure if it will be your taste but worth taking a look.
 
Back
Top