Live data from Hacker News

If Java Is Dying, It Sure Looks Awfully Healthy

drdobbs.com

181–190 of 327 posts

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

#181

Earlier quoted context omitted.

I find the descriptive nature of method signatures to be quite delightful. Unlike other languages like C++, I don't always have to go looking for the function definition to see the types of the parameters it takes, and what exactly was the order again? Combined with Xcode's autocomplete, it saves a lot of time. I shed a small tear every time I have to call a C API with and endless parade of (NULL, NULL, 0, NULL).

In C99 it's possible to use compound literals to implement something like named parameters. You create a struct with all of your parameters, and only include the ones you want to set in the compound literal. Anything not explicitly specified in the compound literal gets set to 0, so the caveat is that 0 can't be a valid value for your parameters.

The book 21st century C talks about that trick:

http://books.google.fr/books?id=_EdbrocXX9MC&lpg=PA183&ots=D...

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

#182
The best thing about java is the ecosystem around it - a massive range of mature and robust open source libs to do just about anything you like (parsing HTML, part of speech tagging, search indexes, neural networks, fast caches, networking tools, web servers/containers, email servers etc etc) Does any other language have this variety available?

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

#183
I haven't programmed in Java but I sometimes read Java source code. I must admit that I like the language which to me is a better C++. However I don't like the way it is used i.e. tooling, libraries and programs. I don't like AbstractProxySingletonFactories, XML configuration files, long method names and lots of other things. That being said I believe that a change in the programming culture surrounding Java may lead to more pleasant programming experience.

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

#184
post #90

Earlier quoted context omitted.

Popular in terms of use, yes, but liked? I don't know, I doubt it. Android and iOS essentially force you to use Java or Objective-C respectively. I don't hate Java, but I don't like it either. It lacks quality of life features that other, similar languages have had for years. I can't stand writing code in it if I don't have to (and don't get me started on Objective-C...) From what I hear from others and read on a wee…

I have been using Scala for both server-side and Android projects. Android doesn't have such a capable VM and Scala is a little wasteful in terms of short-term objects, but using Scala while being mindful about performance implications of the code you write is still better than Java. In fact on Android you can use pretty much any language under the sun, including languages that don't run on top of the JVM. The develo…

[deleted]

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

#185
post #133

Earlier quoted context omitted.

Java runs about 2x slower than C++ for general CPU-bound stuff - (although it does use much more RAM). That sounds slow, but it's faster than most other languages out there. However, C++ does give you the ability to more easily use processor extensions (SSE, AVX, etc), which you can't use from Java AFAIK - which makes a big difference in performance for certain applications.

> C++ does give you the ability to more easily use processor extensions (SSE, AVX, etc), which you can't use from Java AFAIK C++ does not support any processor extensions, they are not defined anywhere in ANSI/ISO C++ language standard. They are a language extension not guaranteed to be available in all C++ compilers in the same form, thus not portable. Java can make use of processor extensions by writing a small Ass…

> C++ does not support any processor extensions, they are not defined anywhere in ANSI/ISO C++ language standard. > They are a language extension not guaranteed to be available in all C++ compilers in the same form, thus not portable.

This is true only if you're a language lawyer, but there's very little point to sticking pedantically to a language standard and not take advantage of the ubiqtuitous language extensions available. All the popular compilers out there support all the latest CPU instruction sets with the same syntax, etc. E.g. xmmintrin.h for SSE, avxintrin.h for AVX.

> Java can make use of processor extensions by writing a small Assembly snippet callable via JNI.

While this is true, you destroy any performance gain with the complexity of the JNI calling convention. It only pays off if you're doing a quite long stints of SSE/AVX/NEON code at once. Wrapping a small vector dot product or matrix multiplication in JNI will not yield any performance gain in practice. So while you can call native code via JNI, it's nowhere near as practical as writing it with intrinsics in C code. In addition, you get compiler optimizations to your native code if you use intrinsics from C, if you do it via JNI you lose all interprocedural optimization.

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

#186
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…

Sigh. This again? A good garbage collector will always reach a higher throughput than "manual" dynamic allocation/deallocation in C/C++. Pauses are a different matter, and can impact latency; in cases where latency is crucial, Java programs either resort to manual memory management or use a commercial low-latency GC.

If you're comparing the JVM's GCed heap with some specific, user-managed allocation scheme, then know that the latter can be done (and is often done) in Java too.

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

#187
How many of you are actually handling big Java projects ? Mine is not that big but big enough to have 15 sub projects, 200 dependencies, 5 people for maintenance, batch, GUI, JEE stuff. The only thing I can say is taht although Java is nice, the maven, release mgmt, spring stuff it needs to be actually manageable is absolutely enormous (the question is, how would I manage that in another language ?). Contrast that with interpreted/dynamic languages... No type safety ? But I don't have to wait 3 minutes 30x a day for my build to complete in order to check that my code is actually running... So well, there's room for compromise.

For me the tru force and problem with the java ecosystem is that it allows to separate concerns in the enterprise : a team to provide some Eclipse plugins, a team to handle release management, a team to deploy thnig on servers, a team for development, etc.

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

#188
post #116
post #90

Earlier quoted context omitted.

Popular in terms of use, yes, but liked? I don't know, I doubt it. Android and iOS essentially force you to use Java or Objective-C respectively. I don't hate Java, but I don't like it either. It lacks quality of life features that other, similar languages have had for years. I can't stand writing code in it if I don't have to (and don't get me started on Objective-C...) From what I hear from others and read on a wee…

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup

Bjarne Stroustrup has no right of saying anything regarding language implementation and validity of users complaints.

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

#189
post #180

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…

Well, yes and no. I'm old enough to remember when Java was launched, and I was getting paid to write Java in '96. At the time it was going to be a whole new way to write software - modular software made of components downloaded on the fly whenever you needed them. That is why package names work like that , com.sun.java.blah meant a class called Blah that you would grab from the server java.sun.com when you first inst…

I was at that birthing as well....and had the joy of using CORBA, I can see my copy of The CORBA Reference Guide by Alan Pope sitting in the "candidates for landfill" area of my bookshelf.

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

#190
I'm just getting back into Java (both platform & language) and I'm really excited about it. It has really matured over the past 10 years both in tooling and application architecture philosophies. I'm really looking forward to pick up Java, Spring, Hibernate (maybe I settle for JPA, not sure yet) and my old trusted friend Tomcat.

Oh, and I might throw in some Scala, Groovy and JRuby in here and there as well.

Post reply on HN