Live data from Hacker News

If Java Is Dying, It Sure Looks Awfully Healthy

drdobbs.com

61–70 of 327 posts

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#61
post #57
post #38

Earlier quoted context omitted.

I'm not talking about how many features the language has, I'm talking about the endless amount of line noise that you need to accomplish simple tasks. Most of what the code does is hidden behind ceremony. Imagine Newtown writing out instructions on how to calculate gravity instead of just writing: F = G((m1 m2)/(r^2)) I really don't understand how a language that can't succinctly express calculus from 300 years ago w…

Languages like Matlab are best suited for expressing calculus. Why are you choosing a poor tool for the job? Most Java programmers don't care about expressing calculus. They care about expressing interactions between web services, sql, and applying rules as the data flows through their modules. Or between user interface elements and service requests. It's all about moving data around, working on that data when you've…

The problems of pushing bits from one server to another aren't that complicated and the pomp and circumstance of java gets in the way of actually accomplishing those things.

As you point out when you have a reasonably complicated problem like applying functions java fails miserably and other languages are a much better choice.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#62
post #52
post #35

Earlier quoted context omitted.

What about java makes it better for high performance / complexity code? I never said there isn't a lot of java code, or that it doesn't work, my assertion is that java is not the hands down choice for high complexity / performance work. If you've got a bunch of mediocre programmers who can't be trusted to make + add things together then sure java is a great choice.

It's a natural fit for enterprise programming where time to implement is usually key and logic is endlessly extended to accommodate whatever new business requirements emerge after the last round was deployed. And robustness is valued more highly than raw performance. Use Java - pay for twice the servers and get ten times the uptime? Done. That means that days or weeks spent hunting your latest memory corruption issue…

Yet again I ask what makes java good for high complexity / performance code and get told it's good for managing mediocre programmers.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#63
post #54

Earlier quoted context omitted.

Automatic memory management...? "Just use Boost" is not a viable strategy when it adds so much complexity in and of itself. I'm not defending Java, but it's helpful to know what the limits of each tool are.

Automatic memory management (especially with a garbage collector) is antithetical to high performance. I like the JVM (for Scala, mostly; Java-the-language can go screw), but there is nothing there really remotely close to C++ and C, and the garbage collector is a very large part of why.. Rust might horn in on C++'s bailiwick, but until then, it's gonna be a while. I strongly disagree that Boost really adds "so much…

Automatic memory management (especially with a garbage collector) is antithetical to high performance.

The LMAX Disruptor pattern would like to have a word with you.

http://lmax-exchange.github.io/disruptor/

http://martinfowler.com/articles/lmax.html

http://stackoverflow.com/questions/6559308/how-does-lmaxs-di...

I'm not just namechecking the Disruptor pattern. I have extensive experience with it. It's about 10% slower than what could be achieved with C -- which is to say, the benefits of not having to program in C far outweigh the 10% loss of performance. And its performance is almost always far higher than what's needed, i.e. the bottlenecks are elsewhere.

I strongly disagree that Boost really adds "so much complexity"

We'll have to agree to disagree, I think. Importing Boost is often a sign that something is awry with the design goals of the project. Either the choice of language is wrong, or the project is too ambitious. Though there are some aspects of Boost that are pretty good, such as its unit testing framework.

if you seriously need shared_ptr, your code design is probably just Not Very Good.

This I fully agree with.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#64

Java may not be dying, but it does take off early on Fridays for golf. Java is not dying the same way Cobol was not dying 10 years ago. It has a lot of legs left but nobody is 'hoping' to use it, they are told to do so. Java is and always has been almost completely a corporate tool. Again, like Cobol, so the 'cool kids' are not going to give it much love. It's too slow to execute to compete with C++, its too slow to…

are these the same thought leaders that ditched ruby for scala or node or clojure?

ill be coding with libgdx and pushing to html5 and android while the thought leaders decide their next move.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#66
post #51
post #44

Earlier quoted context omitted.

Java is not as fast or faster than C(++). The assertion always makes me cringe. I won't say Java is slow(though the startup time is annoying for some tasks), as it does perform better than many languages. But how does it make sense to you that a platform written in C can produce results faster than C is capable of?

What language do you think your favorite C compiler is written in? Now compare that C compiler to the jvm compiler, which has the benefit of using detailed information about the exact system configuration and other runtime behaviours during its compilation phases. Which one has the advantage?

C to both of your questions.

The JVM compiler compiles for the JVM, which is written in C. So, how again can something written in C perform faster than...something written in C?

I'm not claiming that line by line transcription, C will always perform each particular operation faster than Java. But the fact that you could write the entire JVM in C means that you could recreate the exact platform and replicate the results. Is that sane? No, not really.

Comparing languages is typically silly, as it mostly boils down to implementation. If you -really- intend to compare speeds of languages, it would necessitate writing the best possible code in both languages, which may or may not even resemble each other. Under those circumstances, Java is not capable of beating C. Ever.

I don't understand why this is an argument anymore, it doesn't really even make much sense...unless my definition of 'language speed' is unusual.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#67
post #44

Earlier quoted context omitted.

Java is not as fast or faster than C(++). The assertion always makes me cringe. I won't say Java is slow(though the startup time is annoying for some tasks), as it does perform better than many languages. But how does it make sense to you that a platform written in C can produce results faster than C is capable of?

dkuntz2 said C++, not C. But in any case, it's perfectly possible that a platform written in C could produce results faster, because it's not an interpreter but a compiler that translates the application directly to machine code, and which could benefit from optimizations not available ahead-of-time.

It is perfectly possible to write JIT optimizations in C/C++. In fact, HotSpot does just that.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#68

Aside - I miss the paper Dr. Dobbs' Journal from the early nineties. Is there a modern equivalent?

Dr. Dobb's puts out a monthly PDF issue. It's smaller in terms of content than the paper issues of the 90s, but it's in that mold. Also, the website posts new feature articles every Tuesday, covering a fairly wide range of programming topics. Most articles have code.

Yes, I know about the PDF issues, and I also realize that there are so many great resources on the web that having a dedicated general purpose programming magazine doesn't make business sense anymore.

It is quite possible that what I miss is really my childhood and the excitement of waiting for the magazine and learning about things (most of which I didn't fully understand) with wide-eyed wonder. But of all the computer magazines I have ever encountered I think it was Dr. Dobbs' that struck the best balance between CS academia and the hands-on world of programming. It straddled that world between abstraction and application perfectly in my opinion.

It would be a wonderful role to resurrect in the age of big data and increasing statistical and algorithmic sophistication. Won't happen, though. So I'll just wallow in my moment of nostalgia :-)

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#69
Java is not dying, it has just started its long slow decline like COBOL did back in the 1980s. But COBOL is still with us and so will Java be with us for a long time. But the momentum is picking up on alternate JVM languages, in particular Grovy, Scala and Clojure. Of course there is also Python(Jython), JRuby, PHP and many others that run on the JVM, but Groovy, Scala and Clojure are the triumvirate that is picking up steam and will end up pushing Java down into the depths where, like C, it will remain as the tool of choice for building JVM libraries.

The Oracle JVM is also not the only JVM available these days and there are even some commercial JVMs that are higher performance than Hotspot. I think one could make a strong argument that the JVM will outlive Java itself by a large margin. Say, Java fades out of common usage by 2050 but the JVM is still going strong in 2150.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#70
post #17

There's a lot wrong with Java, but even while having moved on and learned / used professionally many other languages I keep coming back to it and its ecosystem. There is still not another language / platform that provides the same level of a variety of things that are important to me: * platform independence * performance * low level features * simplicity and clarity (for reading, writing not so much) * infrastructur…

You can get all of that and clearer writing in c#, with Intellisense.

I hope I get no down votes from the following comment. This is not true, C# can be thought as superior to Java, only if you intend to be completely immersed in the Microsoft stack and this assertion is still debatable. I personally like Java more than C# just because Java is truly platform independent and fully open source. When you have two similar software products the one which is open source will always be a better choice. I think Java has a bright future.
Post reply on HN