17 comments

[ 3.0 ms ] story [ 40.5 ms ] thread
TL;DR Functional programming evangelist bashes object oriented languages.
> it still isn’t competitive with C or C++ and, with a little love, Haskell and OCaml can or will eclipse it in that domain

Oh please. It has displaced C and C++ for the vast majority of programming. And call me when people other than a few rabid fans and academics are actually using Haskell and OCaml for real software development.

I think that quote was about performance. Full context:

> While it performs pretty well nowadays, it still isn’t competitive with C or C++ and, with a little love, Haskell and OCaml can or will eclipse it in that domain.

But don't underestimate C and C++. They're still widely used; by some measures, moreso than Java.

Programs written in C and C++ are certainly much, much, much more widely used than programs written in Java.
Yeah, people forget that the operating systems that run the world are written in C/C++. C underlies everything.
Are you serious ? There are what a dozen operating systems in the world.

There are probably tens of thousands of companies who are using Java for business applications. Java and to a lesser extent .Net run pretty much everything in the enterprise.

Yep, even Google use it, but they are trying not to, and you should too.

Enterprise software is a cess pool of crappy software written by underachieving engineers and dominated by consultants who literally make money through failure.

If you deny this then we probably need to talk about Evolution and Climate Change next!

I'm using Java to process over a trillion files under 3 days. Sometimes its the programmer skills, not the language itself that should be blamed about performance.
And that data is meaningless without hardware specs.
I don't love java. Not at all. All my out of work coding is in other languages - primarily clojure since I can make use of the java I write at work.

However, my company has a risk management system that was written in C++. It's a system of large matrix operations that uses a lot of CPU and memory. Being one of the few neck beards at my company who had ever written C++, I was tasked with translating it to java. In order to guarantee correctness, I slavishly maintained the algorithms, classes, etc. This allowed me to compare intermediate results at each step, but obviously didn't allow for any improvements I might otherwise have done. I was hoping for a runtime differential of 2x over the C++ version which would have been adequate for our needs. I paid no attention to runtime performance, though, since correctness was the prime goal - we're talking about real money in the balance. Once I was satisfied with the numbers, I ran some performance tests. I was shocked to find the jave version ran 40% faster than the C++ version. And this was prior to performance enhancements that I was able to put into the java version added largely by the huge ecosystem that has built up around java/JVM programming.

So, yes, I don't like java, but it's hard not to respect it. Obviously, one example doesn't end the debate about performance, but I'll admit to having been shocked at this result.

There really isn't much difference when comparing code that does the same thing in roughly the same way. As you noticed, you can even get some performance freebies in managed world for a variety of reasons. However, that's not the point. You can tune your C or C++ to a much higher degree than you can managed code, and that's where they win.
This has been covered ad naueseum. There are plenty of situations where both the C/C++ and Java sides of the fence will beat each other in benchmarks. Especially if you have average developers programming both platforms.
Yes, that "average developers" part is the important bit. Not sure what your point is here. The parent was talking about their experience in porting C++ code to Java, noting a performance improvement. In terms of performance, you don't use a language like C++ because it is going to be faster than everything else out there in all cases, you use it because you can eek out more performance than you can in using a language such as Java.
My point was that the C++ version had been tuned over several years to get as much performance as it could. Replicating the C++ code in java wasn't the optimal strategy for performance in java, but it was the optimal strategy for getting the correct results. There are many optimizations I could have gotten by rewriting the java code in a manner that took better advantage of java's strengths, but alas the project is in other hands now....
JSPs and Tomcat and XML vs Python or PHP and Apache and JSON?

I know which I find wayyyy less painful.