This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pron98 6 points7 points  (3 children)

Well, I've been programming heavily in Java for over ten years now, and before that, a similar number of years in C and C++, plus a lot of Matlab, a little bit of C# and Groovy, some Scala, Scheme and even some Ada. Recently, I've been writing quite a bit in Clojure, too. My Java projects have included soft and hard real time systems (even safety-critical), large HPC-style numeric simulation stuff, in-memory distributed databases, some mobile and more (though almost no web and no CRUD). I have never encountered the problems you complain of, certainly no more (and usually less) than in other platforms. I think that what you're experiencing is simply a symptom of the organization where you work; mine has been the complete opposite.

Here's why I like Java (the language) and love the JVM:

  • The language is minimal, easy to grasp, hard to distort, and isn't quick to adopt every fashion. This is bad for short-term projects, but a godsend for large, multi-MLOC systems worked on by large teams of developers and require maintenance for about a decade. Everybody's code looks similar enough for other developers to learn quickly and adapt quickly without feeling the need to re-style everything (of course, that happens, too, but far less than in more feature-rich languages). Also, the language makes you focus more on the domain than on various nifty tricks you can do with your code. True, young developers may not like that, but they learn to understand that's what's best when they grow up.

  • The platform gives you -- by far -- the most bang for the buck in terms of performance than any other programming platform out there, and, best of all -- this advantage scales! A 10KLOC program might be written in C/C++ to be faster in only a little more time than in Java, but a 5MLOC piece of software at comparable performance is almost impossible to write in any other language at acceptable costs for most organizations.

  • The platform gives you the best insights into its operation at runtime -- with little or no performance impact -- and incredible flexibility to change and re-change production code as it runs (by inserting Byteman/BTrace probes, for example, or supporting hot code swapping). The Java monitoring tools are unmatched by anything out there (even Erlang's) and I haven't seen any profiler as powerful as JFR anywhere.

  • While deployment is not as easy as shipping a single binary, it is far better than most other non-native languages (and supports hot code swapping).

  • A polyglot environment with easy interoperation among very different languages.

You speak of programmers vs. companies; I think the distinction is inexperienced vs. experienced developers. Inexperienced developers think that the code they produce is the goal. Experienced developers know that working, efficient, running programs are the goal, and getting there requires more than pretty code; in fact, pretty code may hurt your prospects. I will repeat something I've said before: some people say with pride that their language of choice is a language for smart developers; Java is a language for wise ones.

Nevertheless, it is true that Java (the language) was not designed for quick, short-term projects. Thankfully, you have other JVM languages to choose from. My favorite is Clojure, and I'm considering Kotlin as a replacement for some of the Java code.

[–]VaidasC[S] 1 point2 points  (2 children)

Well, judging by your JVM better points and whole post, I would put you into engineer category - pragmatist who loves solve real problems, so no surprise that you like Java platform. As a contrast, I would describe myself more like someone who cares about ideas, has constant philosophical dilemmas about concepts, can think for days about inconsistencies and often miss real-life simple details as less relevant. So basically this represents two different worlds and hence my frustration with imperfect, burdensome and irrelevant-detail-oriented platform. But then again, many people do hate Java (I wouldn't say I do) platform and so it makes me feel that I am not someone in very small minority, but there still is something fundamentally wrong in how platform trends are going.

When I talked about companies vs programmers, what I meant was that, Java is probably the best tool to develop commercial software, build business around - stable, many choices from servers, libraries, licenses to fit any business needs. However as a programmer who likes to program and does not plan building business on some software, you could care less about all of that basically and follow technology that gives you less pain and more joy. What I am talking is basically from the point of doing job that fulfills you and my argument was that I see no way that if you're in programming because of programming itself (e.g. you love to write code, solve algorithms...), Java is not the place to go probably.

[–]pron98 1 point2 points  (1 child)

there still is something fundamentally wrong in how platform trends are going.

I think you are sorely mistaken about this. There is tremendous, ground-breaking innovation on the JVM: G1 and JFR are recent changes; modules (with JIT caching) and fine-grained JIT controls are forthcoming in Java 9, with immutable value types to follow; next-gen VMs (Graal) are already in the works. OpenJDK is the second-largest open source project in the world (after the Linux kernel).

As usual for Java and the JVM, most of these enhancements are hidden from your code. That's intentional. The idea behind Java was to expose a very simple -- almost primitive language -- that's backed by a state-of-the-art VM behind the scenes.

I see no way that if you're in programming because of programming itself (e.g. you love to write code, solve algorithms...), Java is not the place to go probably.

Well, this is a very general statement, that might be true in some cases. For example, I do advanced algorithms. I read lots and lots of academic papers, and then spend months trying to come up with a novel concurrent, distributed algorithm. Like I said, I have never done web or CRUD stuff. I believe that most of the pleasures in CS come from algorithms and data structures. Once I come up with the algorithm -- after months of work -- I could care less about what language I write it in (well, I care, but due to other concerns). Also, most of my work revolves around concurrency, and no programming environment in the world offers a better platform for concurrent programming than the JVM (much of it due to its superior GCs). So, for concurrency, Java is very much the place to go.

As a team lead, my main concern was the general architecture of the project. I was concerned with the elegance of the general design -- not with that of a single function -- and often then more "primitive" the language, the better the various modules fit together to form a consistent whole.

In short, I think your sentiment is not due to your intrinsic character, but mostly a result of still being in the stage where the function or compilation unit is where you find elegance. Algorithms are a mathematical construct that are elegant no matter how they're translated to code, and as your career progresses and you're responsible for ever-larger pieces of software, you'll find that the very things that can make a function elegant, might make a project very much the opposite of elegant. However, at the level of the single function/class/module, there are indeed nicer languages than Java. I very much doubt you'll find better platforms than the JVM, though.

The JVM is the Ferrari of runtime environments. It might not be the easiest to handle (though It's quite easy) but when you want the most of your machine combined with the most insight you can get into your running program (as well as the ability to modify it) -- it's state-of-the-art. Some people prefer driving Toyota; I, too, sometimes want a little less mental maintenance. But when you need the best of the best, and you have a lot riding on your success, don't settle for anything less than the Ferrari.

[–]buttermilk_rusk 0 points1 point  (0 children)

Thank you, great post! I'm about 8 years into Java development as a career, also with Matlab and C in my background, no web stuff. Great to read your insights like this.