9 ms·
Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Fou
by yagodragon 6y ago
Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Foundation), governments, big tech companies such as amazon, ibm, google, apple for many large scale services. It can do web, ml, GUIs, it's still strong among academics. On top of that it offers a great programming experience with excellent IDE support and it's ecosystem is huge. Even if you don't like the language itself , you can choose between Kotlin,Scala,Clojure that run on the JVM.
I think that Java is seriously being downplayed by HN crowd.
- pkulak 6y agoI think it's the JVM that's the real win for Java. At my work we have a mix of Java, Kotlin and Scala and they all Just Work in our deployment pipeline that was built with just Java in mind.
- AnimalMuppet 6y agoI think it's the libraries. They're like Barbie - they have everything. You need, say, to store affine transforms in your SQL database? Java can bridge those very different worlds. (It literally has affine transforms in the library.)
- cesarb 6y ago> I think it's the libraries. [...] they have everything. On the other hand, they need to have everything. In many other languages, it's common to just use a library written in a different language. For some reason, the foreign function interface of Java seems to have been designed to be hard to use, so instead of using an already existing library, Java developers tend to go through the route of "Rewrite It In Java".
- marvy 6y agoWith Project Panama, they are finally trying to make calling non-Java code easy.
- pjmlp 6y agoThat was indeed done on purpose, Mark Reinhold has had a talk about it once, but as noted on the sibling comment that is being fixed.
- neeleshs 6y agoAlso because libraries in other languages often have platform specific dependencies.
- imtringued 6y agoIt wouldn't be portable if it wasn't written in Java.
- CamouflagedKiwi 6y agoIt's very widely used, that's for sure. But it's increasingly not a good choice - in the examples you give - web, ML, GUIs, it is not first class in any of those (and not near to it in the latter two). What's next for Java should be relatively little change; let a language like Kotlin without all the baggage be the way ahead on the JVM. There's a remarkably good compatibility story there; way better than basically any other language ecosystem out there, that's the real legacy of Java.
- lostcolony 6y agoI like to think of Java as 'a reasonable choice for almost any problem'. Almost never the best one. If you're looking for a single language to standardize on for all the things corporate-wide, it makes sense. But don't lie to yourself thinking you've picked the best tool for any job.
- bird_monster 6y agoYeah it's a losing battle to suggest Java is mostly fine on HN. In this bubble we only use FP and/or Go/Rust and/or C++.
- IceWreck 6y agoFP ?
- chishaku 6y agofunctional programming
- neuronic 6y agoI hope that most programming is functional to someone.
- deleted 6y ago[deleted]
- chrisseaton 6y agoThat's not what they mean. https://en.wikipedia.org/wiki/Functional_programming https://en.wikipedia.org/wiki/Functional_programming
- ed25519FUUU 6y agoThose are the languages we love at least. I’m willing to bet that most of us are java developers to pay the bills.
- mrjoelkemp 6y agoIn my opinion, Java as a web language is good when you don't need to really understand what's happening (like in low-traffic situations). If concurrency isn't an issue, then the massive amount of libraries can help you a lot. In high-traffic environments, that ignorance punishes you. I've always felt Java and the JVM are of the mindset that you need a Ph.D. to even understand how it works or how to configure it, and if you can't get it, then you're just a bad programmer. You need to know if you're blocking threads, if there's memory contention, and if libraries you pull in are using the forkjoin common pool (which you're likely using as a default threadpool). And when something blows up, finding the reason (even for any of the above issues) is really tough. You can use flight recorder, heap dumps and gc logs all day, but good luck navigating it all unless you're a genius. I've seen too many devs end up shrugging and hoping the issues are transient. Even figuring out proper threadpool usage isn't straightforward. Look at the number of concurrency abstractions just to model concurrency in your system: https://www.youtube.com/watch?v=yhguOt863nw https://www.youtube.com/watch?v=yhguOt863nw. It's ridiculous. Lots of large tech companies "seem" to "make it work." But if my experience is at all similar, they're just relying on a handful of Ph.D.'s to hold the hands of the rest of the company when it comes to troubleshooting. Part of the reason I fell in love with Elixir/Erlang and the BEAM is that it provides a simple (actor) concurrency model (with a single concurrency primitive, a process) and guardrails (time-slice scheduling) to prevent libraries from shooting you in the foot. OTP's observer makes finding bottlenecks a breeze. For the web, taming concurrency feels way more important than any cpu-crunching perf gains the JVM can give you. I'm too stupid for the JVM; I'll stick to tools that take away numerous categories of complexity and get me closer to mastering my system.
- MaxBarraclough 6y agoIn defence of Java, I read somewhere it's 25 years old ;-) Part of the reason for its success has been its strong commitment to backward compatibility, so it's to be expected that it might accumulate many ways of doing things. Python wisdom tells us this is often a Bad Thing. [0] I imagine Java's approach to concurrency and parallelism might be quite different if it were designed today. [0] https://wiki.python.org/moin/TOOWTDI https://wiki.python.org/moin/TOOWTDI
- coliveira 6y agoThe main problem with Java is its concurrency model, which gives incentive to the creation of threads that fight for resources and introduce bugs. This seemed a wise choice in the 90s, but as concurrency has increased several-fold in the last 25 years, the model cannot scale to real software needs. It is the Java equivalent to pointers in C.
- kasperni 6y ago> the model cannot scale to real software needs. And somehow it is still widely used within Google, Facebook, Amazon, Twitter...
- coliveira 6y agoC/C++ are also used at Google, FB, Amazon, etc. It doesn't mean that it's not a problem.
- tomc1985 6y agoI'd bet you're alienating well over half the entire field of software engineering with calling Java, C, and C++ "problems".
- coliveira 6y agoYou're misinterpreting what I said. I talked about the "main problem with Java", and with C/C++. Saying that a tool has a problem doesn't mean it is useless, far from it.
- conjectures 6y agoThis isn't actually a rebuttal of the point.
- brown9-2 6y agoMost of those companies are not writing one-thread-per-request servers, they write non-blocking / async IO Java.
- agumonkey 6y agoI tried. I honestly tried. Java is my #1 most hated programming language (maybe unless you forget everything before 8 .. and even then.. import java.util.function.BiFunction makes me want to run to a mountain)
- StreamBright 6y agoJava is still my default language after so many years (even though through Clojure). I think Java's biggest advantage is the JVM though, if it had an ML programming language on the top without null and proper interfacing to Java packages I would never look at anything else. Just like .NET has F#.
- wk_end 6y agoWhat's your opinion of Scala?
- non-entity 6y agoNo the commenter you're replying to, but I've actually looked into Scala a few times and while it has some big criticisms I don't necessarily disagree with, there we're many things I actually liked about the language. I briefly considered picking up for a side project, but ultimately went with something else that provided more relevant features and abstractions. Sadly, in the real world, it seems that Scala is mostly relegated to the Spark world.
- StreamBright 6y agoGreat question, I think it is a good alternative to Java even though it is trying to do too much. Not sure it is happening because it is trying to build on the top of Java or some other reasons. Scala is still good and productive language though! https://www.youtube.com/watch?v=v1wrWQcqLpo&ab_channel=Java https://www.youtube.com/watch?v=v1wrWQcqLpo&ab_channel=Java
- hn_throwaway_99 6y agoIronically, while Java was the original "write once, run anywhere" language, it never succeeded in that regard (e.g. browser applets were never popular). Ironically, I believe Javascript has. I was pretty much exclusively a Java programmer for the first decade and a half of my career, before moving to Node and TypeScript. I don't think I could ever go back at the point. Most importantly, this is my first time where the entire code base (front end and back end) is in the same language and toolchain, and I think it is the single most important thing I've seen in years for improved team productivity. The ease with which engineers can go between front end and backend is an incredible boon that shouldn't be underestimated.
- WalterBright 6y ago> Java was the original "write once, run anywhere" language That crown properly belongs to the UCSD P-System, which was the Java of the 1980's. It was the same idea as Java - compilation to a bytecode which an interpreter ran. It failed because the interpreter performance penalty was too high. Java also started out as an interpreter, which made it too slow. Steve Russell of Symantec invented a JIT for it, and like the lumbering Allison-engined P-51 getting a supercharged Merlin, it brought Java to life.
- hota_mazi 6y agoI don't know about that. I coded in UCSD-P quite a bit (and played a few games written in it, Wizardry on the Apple 2 anyone?). But UCSD-Pascal never reached a tiny fraction of the audience that Turbo Pascal did.
- WalterBright 6y agoTurbo Pascal certainly had more users, but it was never "run anywhere".
- hota_mazi 6y agoNot sure what you mean by that. Are you talking about the host OS and the fact that Turbo Pascal was Windows only, as opposed to Pascal UCSD which was a VM?
- haolez 6y agoJava is a language that protects your investment. If you write code for it today, it will probably run and be easily deployable in the future by default. The same cannot be said for Python and JavaScript, for example. At least not by default.
- cuddlecake 6y agoNot sure if being "deployable" is an issue, considering docker exists. So, anything is deployable in the future by default, given a machine running the correct docker image. Or am I misinterpreting the argument?
- spullara 6y agoJava code will run on the new ARM machines Apple will ship. Running your Docker code in the same environment is not going to be pleasant.
- saagarjha 6y agoJava already runs on the new ARM machines ;) Someone has OpenJDK building for the server variant, and it works quite well already: https://github.com/gonzalolarralde/jdk/tree/gonzalolarralde/dtk-support-1 https://github.com/gonzalolarralde/jdk/tree/gonzalolarralde/.... Apple had the C0 interpreter up on the day of the announcement because they needed it for various Xcode tools.
- cuddlecake 6y agoI must admit I am completely ignorant to how much of an issue this is in real life, but I'm also in the privileged position of having the backend code compiled and run on remote servers, rarely on my own machine. On the other hand, I'm a junior developer, so I might yet stumble on this problem's relevancy at some point. To be fair, docker is already a pain on my machine (using Fedora 32). I gave up on using docker at some point.
- thu2111 6y ago
- codeulike 6y agoAnd it gave us Minecraft of course
- chrisdalke 6y agoNot only that, but Java's reflection features opened the door for a huge, vibrant modding community that is arguably one of the largest among any PC game. Very early in Minecraft's development, people were already decompiling/modifying/injecting their own mods, and a lot of frameworks (Bukkit, Spigot, etc.) emerged to provide a common API for modding. The large modding community arguably had a very positive impact on Minecraft's early success -- Although I don't have any quantitative metrics to reinforce that point, I fondly remember early Minecraft as having a relatively technical community that tinkered with the game as a sandbox for countless custom experiences.
- bishalb 6y agoHN downplays it because Java isn't hipster enough.
- blackbeard334 6y agothis thread does a good job in summarizing java https://twitter.com/cpurdy/status/1261139068672507905 https://twitter.com/cpurdy/status/1261139068672507905 excerpt Nothing competes with Java. Nothing. Because Java wasn't about destroying the competition; Java was about creating a reality that otherwise did not and could not exist. It was about imaging the "what could have been", and then creating that.
- socialdemocrat 6y agoThis is the nature of technology and economics though. Widely used and mature technology will almost by definition be behind the state of the art. Progress is always happening and by definition a new language cannot achieve mass adoption over night. Java is big because it has been around a long time and was decent when it came out. Java was the Go of its generation. Nothing radically new but wrapped up in a way people liked and was familiar with in large part due to the success of C/C++ prior. Whatever achieves mass adoption after Java will also be behind the times by the time that happens, and as geeks we will have moved on to whatever is newer and cooler. I am pretty neutral towards Java as a language. My biggest issue is with the software culture of over-engineering and complicating things. Java guys seems very dogmatic about how to design software.
- billman 6y agoJava is pretty solid, but not percieved as cutting edge anymore, even though they are still improving it. I think Oracle has done a better job then I originally expected. I think the ecosystem is by far it's biggest advantage. It's a integration target for many projects just because it has such wide adoption.