5 ms·
I'm genuinely curious as to why new products are constantly written in Java. My experience with the language is far from pleasant. Is it because people actually
by baby 10y ago
I'm genuinely curious as to why new products are constantly written in Java. My experience with the language is far from pleasant. Is it because people actually like the language? Is it because there is no other alternative when it comes to solid development? ...?
- drinkabeer 10y agoI think predictable performance is a major reason. Also, there are loads of developers which are still using Java, so you don't need to worry about expanding your teams and teaching hordes of developers a new development setup.
- zintinio5 10y agoIt has good tooling, IDE support, lots of people know it, it's fast, relatively easy to write, accessible from Scala, Groovy, Clojure, etc. Java is a step removed from having to write a system in C or C++, but you don't need absolute control over every single detail (garbage collection is acceptable). Most development happens in Java, C#, or C++, just not on HN. There's something of an inertial effect with Java, where people continue to write Java because everyone else writes it (and thus it continually improves). What other platforms do you know of that have a similar track-record of performing in large-scale software?
- abritinthebay 10y agoIt's not bad once you strip out most of the crap that it tries to foist upon you. But honestly...? It's taught in schools a lot so more people are familiar with it. The greatest disservice to an entire generation of programmers is Java being standardized at Universities.
- EdSharkey 10y agoAs I understand it, Twitter is heavily invested in Java and the JVM. They maintain their own fork of the JVM that they tweak for low latency. As a starting point for speed and stability, the JVM is top of the line. I like coding with Java 8. There's lots of new syntactic sugar that let you cut down on all the boilerplate and cool new standard library features like Java 8 streams that let you do functional programming. The best part of Java 8 streams is they perform really well. You get more readable code along with better performance.
- gshx 10y agoGo-lang is good but not as mature. Other than that, there's C++ and Erlang/Elixir. Not a whole lot of mature choices out there. For most of the critical production grade systems that need to be secure, have to scale and perform predictably, you don't want to blaze the trail.
- zintinio5 10y agoI think your last point hits the nail on the head. There's a large amount of risk (especially at Twitter's size), and nobody wants to be saddled with an enormous and embarrassing failure. In addition, you need many hands to build the system, and finding developers for <favorite lang> that ALSO have relevant experience could be difficult. You could make arguments that developers in <favorite lang> are 10x as productive as your typical Java dev, but few people are going to take that chance. I'd say even Scala is still considered bleeding-edge at a lot of companies.
- fizx 10y agoLet's say you want a GC'd language (no C, C++) on *nix (no C#), good/varied libraries to work with (no esoteric languages), good performance (no Ruby, Python), reasonable options for implementing concurrency (no Javascript), what's left? Looks like a JVM language (Java, Scala, etc), or Golang. Java has better tooling and more mature implementations. I personally find modern Java nicer to write than Golang (though Scala nicer than both). These days, it comes down to whether the JVM memory overhead is a big deal on the specific project, and if not, for the class of projects discussed in the previous paragraph, I'm probably choosing Scala (but if my teammates object, then it's back to Java).
- jsmthrowaway 10y ago> Let's say you want a GC'd language (no C, C++) IOW, "Let's say you want largely random pauses to impact latency non-deterministically." I'm not knocking GC, but it has serious consequences in systems that make this a weird assumption with which to start, particularly the "big" GC languages that you named. Scala in particular with its immutability generates a lot of garbage if you are not careful, and we were constantly fighting GC pressure (and, indirectly, our achievable concurrency and efficiency) at a household name Scala app. The number of JVM developers who are aware of this and capable with the memory subsystem -- i.e., off-heap strategies such as that used in Flink (relevantly) and some of the clever speedups in netty -- are dwarfed by the number of JVM developers in the whole, so you really need someone who understands these problems to efficiently scale a JVM language. There are better systems languages if you can move away from GC, such as Rust. And modern C++ is fantastic for systems, and it's too bad it gets overlooked because of bam, your first assumption there. Most systems at Google are in C++ because they invested into the infrastructure that you need to support it. It should tell you something that they're heavily involved in each new version of C++. (I'm talking about systems, not applications. GC is a viable tradeoff for programmer productivity in applications.)
- fizx 10y agoI'm excited for Rust for the reasons you talk about, but when I tried it a year ago, FFI was broken. I'd like to find a reason to retry it soon!
- notJim 10y agoI actually like Java pretty well. The language itself is mostly pretty OK, the tooling is super mature, it's typed which is huge. The community has a lot of smart people. Definitely not something super-exciting or my favorite language, but overall it's just pretty smooth to work with. I'm curious what you found unpleasant about it.
- draw_down 10y agoWell, sometimes other things matter than developer ergonomics.