14 ms·
I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains goin
by ilovecaching 8y ago
I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars.
Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it's also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now write ubiquitous apps in basically every language. There's no reason to deal with the JVM and it's domain knowledge when you can write a nimble Go app for your backend and a Javascript app that will run on mobile, web, or desktop. A VM language? You mean v8 sandboxing and web workers; WASM which lets me write C, C++, and Rust all of which can talk to Javascript APIs. All of my services are stateless and ephemeral. Crashing is expected, and I can use host monitoring tools instead of introspecting the JDK. On the cloud it gets even worse for Java. Why use a meaty framework like Spring when I want to just spin up a bunch of micro services, or have an API gateway kickoff a bunch of lambda jobs.
Java also took OO in so many terrible directions. OO defined by it's creator looks nothing like the enterprise OO that big business sold to commoditize programming, which now only exists as a ball and chain on legacy systems.
One day Java will be like Cobol. There's probably a lot of money for Java developers for many more decades, but god I do not envy anyone that has to do it.
- ellard 8y agoSerious question: Isn't Java still one of the default languages if you are choosing a "safe" language to build and maintain a large piece of software? Considering how long it's been around and how many libraries exist for it now, i've generally viewed it as a language that's: - fast enough for most things without a lot of pitfalls/gotchas - easy enough to read for most developers - easy enough for most developers to pick up if they've never used it, even if they aren't exactly enthused by the idea of doing so - supported enough that you'll never be the only person who is debugging something - widely used enough to never be alone when you are trying to use it in unsupported ways - has commercial support from multiple companies Basically all the things that a lot of "enterprise" companies love. Edit: formatting
- wongarsu 8y agoAll of those points are also true for C#, which imho fixes a lot of Java's problems and is a much nicer language. With .Net Core maturing you even get the "runs everywhere" factor (at least everywhere you care about, i.e. Win+Linux+Mac), and Microsoft is a much better vendor than Oracle.
- evil-olive 8y agoI'm very happy to see .NET Core getting more stable and mainstream (I miss my days of working in C# even though I don't miss Windows) but I think running it on Linux for backend microservices still counts as fairly off-the-beaten-path compared to the safe, "no one ever got fired for doing X" choice of using plain ol' Java.
- cafebabbe 8y agoYes, albeit with noticeably weaker libraries/ecosystem.
- threeseed 8y agoYou can still have a more modern language i.e. Scala, Kotlin on the JVM whilst not abandoning the unparalleled array of libraries that the Java ecosystem offers.
- deleted 8y ago[deleted]
- pjmlp 8y agoAs someone that works with both stacks since their inception, there are tons of platforms with Java compilers, where .NET Core isn't even a thing today, and there are tons of .NET libraries that will never leave .NET Framework. So it isn't like just exchanging one for the other like that.
- james_s_tayler 8y agoI'm finding library support quite good for .NET Core tbh. Not perfect, but it's not at all a barrier to adoption.
- _bxg1 8y agoJava has evolved pretty far past its strict OOP roots. I haven't kept up with the last few versions, but it added lambda functions way back in Java 8, for example. There's definitely syntactic baggage holding it back in some ways, but it's added lots of features for more modern functional-programming styles (one mentioned in this release is expression-style switch statements). More importantly, the JVM ecosystem is much bigger than Java itself. The JVM is a highly-optimized, cross-platform, garbage-collected environment on which people have built much more progressive languages that lack the syntactic baggage of Java: Scala, Groovy, Clojure, Kotlin. Clojure is one of the most popular and performant Lisps we currently have, and Scala is one of the closest things we'll get any time soon to a practical version of Haskell. Both of these projects got to avoid building their own garbage collectors, which is an enormous lowering of the effort barrier. And to top it all off, all of these languages' binaries are interoperable, which not only allows you to use different ones for different parts of the same system, but makes it much easier to gradually migrate your legacy codebase to a newer, better language. I don't know if I'd start a new project in Java-the-language, but it's far from a Cobol situation.
- ilovecaching 8y agoIt seems to be a popular notion that adding constructs common in FP is somehow a modernization of C++ or Java. FP isn't a set of features, it's a style of programming. It's actually a bad idea to try to retrofit a paradigm on top of an existing language. You should build tools that do one thing well, and if they no longer suit your style of programming, you should switch to a tool that is designed to fit your needs. A lot of my reasoning was criticizing the JVM itself, not Java. VM languages add unnecessary complexity in the post container world where ephemerality and kernel APIs (containers) can give the same advantages, although I think Kotlin and Clojure and remarkably good languages.
- coldtea 8y ago>It seems to be a popular notion that adding constructs common in FP is somehow a modernization of C++ or Java. FP isn't a set of features, it's a style of programming. And historically, nobody cared for that style of programming in its pure form (where "nobody" is in the casual sense: a few FP-lovers, but not the 95% of working programmers). From 1960 to today it remains niche in its pure form, even the most popular language following it fully (e.g. Clojure or similar) is still a niche language. We found out, on the other hand, that people care for mixing that style of programming with OO, imperative, reactive, and other styles. And that's what modern JS, Java, C#, Rust, etc (even C++) give us. And since FP is a style, it can be followed quite effectively in almost any language -- as long as it has some basic features, which, as you observed, Java has added.
- tw1010 8y agoThough I also have sympathy for those stuck in it, I kind of wish it would die just so I didn't have to be afraid anymore that I'd one day get stuck with having to use it after a sad sequence of bad luck ending with having to take a job in desperation.
- ses1984 8y agoThe Java ecosystem is still there and still rich. It didn't go away or stop growing because golang was released. You'd rather use wasm to write c to talk to javascript apis? Your case against Java might be more compelling if it wasn't so gross itself.
- ilovecaching 8y agoYou're only rich if everyone else is poorer than you. At the point Golang, Javascript, Ruby, and Python (these are just the ones I use) have huge completely open source ecosystems. Java's ecosystem is no longer a convincing argument that we should ignore everything else about the language and it's place in the current line up.
- ses1984 8y agoNo, they are all rich. But I would really hesitate to compare java to js, python, ruby, etc. They aren't as interchangeable. I use all those languages too. Use the right tool for the job. Don't be dogmatic. And don't disparage others. Would I start a new project in Java? Probably not. But I might reach for other jvm languages that were mentioned elsewhere. I'm definitely not too cool to work on an existing Java project. It's fine.
- ilovecaching 8y agoDon't conclude that someone is being dogmatic without compelling arguments. Java is a technology, it's ok for it to be superseded by changes in the landscape. I also never said that people should stop using Java, I simply said I felt bad for the people that had to work with it given that it's obsoleted by improvements in sandboxing, package management, and language design.
- sabareesh 8y agoWell I wish predicting future is this easy , as of now the place where I work we use lot of spring (Spring cloud) completly microservice and it is only reason I believe java is still alive. Spring makes things lot more easy for us atleast. But I have to agree with you regarding Oracle May be you will be interested in this article https://spring.io/blog/2019/03/07/has-there-ever-been-a-better-time-to-become-a-java-developer https://spring.io/blog/2019/03/07/has-there-ever-been-a-bett...
- rb808 8y agoIronicaly I'm the other way around. Java is a pretty good platform, save the GC pauses. However I really dont see what benefits Spring brings. Spring Boot is great for prototyping and trivial apps, but for big systems you really want to break it apart. DI is better done with ServiceLocators. Some of the smaller libraries like Spring Shell, Spring Mobile are junk. And I still see lots of XML config that you dont know if they'll fail until you try to run them.
- jimbokun 8y ago"Spring Boot is great for prototyping and trivial apps, but for big systems you really want to break it apart." Any practical advice for making this happen? I have a Spring Boot system I wrote and am responsible for, but now I just want the pain to stop.
- spricket 8y agoYou need to take the library approach. It's much like react vs angular. With angular, and spring, you get a ton out of the box but much is mediocre. Like React, you can out together your own "best of breed" java stack. It just takes a lot more work. Look to replace one component at a time. For DI Guice or Dagger2. For REST Vert.X or Jersey. Logging Logback. Metrics, DropWizard Metrics. OAuth ScribeJava. Hibernate for Spring Data. Take a look at the "awesome java" repos and choose your poison. I'll warn you now that while you can end up with something far better you lose the coherency of Spring. Of your organization doesn't have a good "apprentice" setup all the new devs will be utterly and hopelessly lost. And good luck finding a Dev that knows 20+ libraries vs "Spring". Rolling the libs was worth it for us but probably not a lot of eng orgs If you're just looking for a drop-in Spring replacement you can't go wrong with DropWizard. It's a solid combo of best-of-breed libraries and has quiet support/adoption by many huge companies
- wpdev_63 8y agoThere's definitely alot of 'enterprisey' java code out there but that has more to do with the way people code than the language is now. Functional programming(.sort, .map etc) introduced in Java 8 allows more concise code and less boilerplate. Even with Rust, Go, and .Net core out there it's really hard to beat Java's battletested libraries/frameworks and excellent tooling. Java is still very relevent today and will probably still be for a very long time.
- ilovecaching 8y agoBattle tested and tooling really aren't compelling arguments anymore, Java is very middle of the pack in both regards. Go is running as the basis of the next generation infrastructure in Kubernetes, Prometheus, Docker, Terraform... Elixir has revived Erlang, which now has great tooling in mix and is well known for being highly reliable. Go, Javascript, and Rust all have real package managers (even Go with mod) that are bundled with the language and come with auto formatters, vetting tools, etc. Also, funcitonal programming is a style of programming, not a collection of features. Just because you have a map and sort method and a hacked in lambda syntax doesn't make Java anything less than OO. Multi-Paradigm usually means one paradigm with a bunch of extra crap in there to make bike shedding easier.
- saagarjha 8y ago> Just because you have a map and sort method and a hacked in lambda syntax doesn't make Java anything less than OO. Maybe not fully functional programming, but something that's quite pleasant to work with to be sure.
- wpdev_63 8y agoIf you're really that much of a language snob then you should checkout kotlin. It has seamless integration with Java and has the _best_ ergonomics I've encountered language wise. Go can't even get it's packaging story straight and once again doesn't have generics which makes 'functional' programming a no Go;)
- 8y ago
- brianpgordon 8y agoThe JVM powers Kotlin, Scala, and Clojure, which are all as sexy as golang.
- eweise 8y agoway sexier actually
- bassman9000 8y agoWhy use a meaty framework like Swing I'd suggest updating your misconceptions regarding Java before posting Yet Another Tirade about it. E.g. the Javascript module/npm ecosystem is an absolute mess compared to any sane package/project description system, yet few people would disqualify JS for it.
- chasingthewind 8y agoI'm using Java every day to deliver software that works to people who want solutions to their problems. It's interesting and enjoyable. No need to feel bad for me or any of the other folks happily solving real world problems in Java!
- hota_mazi 8y ago> it's also lost the niches that brought it into existence Applets, JavaBeans, and CORBA. What a loss. > Besides being owned by Oracle, which is enough of a reason to never use Java ever again, That stopped being an issue years ago. OpenJDK is a thing, you know? > Java on the web is dead, I don't think you have any idea about the hundreds of millions of lines of Java that power the web as you know it today. The rest of your post is filled with equally uninformed claims but I'm going to stop here.
- _bxg1 8y ago> Java on the web is dead, >> I don't think you have any idea about the hundreds of millions of lines of Java that power the web as you know it today. Presumably they meant Java in the client, not the server.
- unclebucknasty 8y agoThat's an impressive rant and can't disagree with some of it, but you're nearly a decade behind in your assessment of java in the Enterprise. New deployments of EJB apps have dropped precipitously (never should have existed), and Java still enjoys wide Enterprise use. Part of the reason big businesses were able to abuse enterprises with their abominable Java server stacks is because corporations were slow to trust open source. But developers persisted and open source became too compelling to ignore, creating the upward pressure to embrace it and break the bloated and overpriced enterprise app server's stranglehold. This likely prevented the demise of Java that you suggest has happened. In fact, when it comes to enterprise these days, you're pretty much either a Java or a .NET shop.
- pjmlp 8y agoThe large majority of enterprises I work with use both, depending on the use case.
- simonsaidit 8y agoIm loving it, i analyze and fix issues across a lot of platforms and languages and for me java is probably the least troublesome of them all. you will see a lot of good practices and standards established that when trouble hits which i find rarer in java its usally also easy to deal with. Not gonna mention other names but i find the practices and maturity of a lot of more hip languages lacking a lot still.
- vbezhenar 8y agoSo far I did not find anything comparable to replace Java for website server language. Go is a terrible extremely verbose language without vital features. JavaScript on Node is limited by single-thread and JavaScript itself is a terrible language (along with other dynamic languages like PHP, Python, Perl, Ruby). Rust is awesome, but I don't think that it'll be ever usable for mediocre developers, therefore it can't be a safe choice for ordinary project. The only reasonable alternative is C#. But it has to go a long way to reach Java's level of stability and trust on non-Windows servers.
- LASR 8y ago> JavaScript itself is a terrible language (along with other dynamic languages like PHP, Python, Perl, Ruby) You know, I used to think that languages had a single axis of Good. And each language sat at a certain point in that one dimension. After several years each of experience writing large web applications using C++, Java, C#, JS, Python, Ruby and Go, that mental model of languages being good, bad or terrible seems incredibly naive now. But overall, if someone were to ask me to write a web app today, I would probably use Python server-side and break it down into microservices. Client-side, probably just pure js + HTML5 APIs. Why? Because I don't have the time to argue about languages being better or worse. I am too busy writing code that does useful things. In a high-skill rockstar team, dev time is by far the most expensive resource. In a startup environment, using your dev time wisely is the difference between a unicorn and a failed business. Nobody gives a fuck if your route handler executes in 1ms or 20ms. I'll gladly pay the 20x hosting costs if that will get my feature out to customers a week earlier.
- hactually 8y agoBit of a Go fan here so just wondered if you'd qualify what you mean by: > without vital features
- ilovecaching 8y agoVital features is double speak for any Java feature that isn’t in Go.
- 8y ago
- coldtea 8y ago>I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars. Yeah, those poor devs with a rock solid, best of class, platform to write code on, with tons of libraries and tooling. >Java no longer runs everywhere It still runs everywhere where it matters. Nobody really cared if it could run on crappy smart tvs and other such BS SUN tried to push it. 99% of Java use has been for server work and enterprise development, and it remains there. And on mobile, well, Android uses basically Java with a name-change. >Java on the web is dead Java on the web (Applets) was DOA, and has been dead for over 15 years. It's not gonna make any difference now. >and you can now write ubiquitous apps in basically every language Which again is neither here, nor there. People have been using Java as a very strong language for backend systems, application server side work, and enterprise stuff. And those deploy on at most one OS 99% of the time. They don't use Java like e.g. Electron or QT. The only Java apps that are like that and are mainstream are basically IDEs. >There's no reason to deal with the JVM and it's domain knowledge when you can write a nimble Go app for your backend and a Javascript app that will run on mobile, web, or desktop Whatever. >A VM language? You mean v8 sandboxing and web workers; WASM which lets me write C, C++, and Rust all of which can talk to Javascript APIs How hipster. Meanwhile others do real work on Java, with finetuned GCs, mature libraries, and so on. I'm not sure where you've seen all this "WASM and Rust", as both are not even blips in production compared to Java adoption -- and wont be for a while, if ever. >All of my services are stateless and ephemeral Mine don't care much for the latest fads, so there's that. >On the cloud it gets even worse for Java. Why use a meaty framework like Swing when I want to just spin up a bunch of micro services, or have an API gateway kickoff a bunch of lambda jobs. I'm not ever sure what Swing has to do with a Cloud java deployment. Perhaps you meant Spring, but even so, it doesn't make sense. And of course with Java you can always use something like Vert.x, which tops the performance charts for microservice work -- so much so, that the others are not even on the radar. >Java also took OO in so many terrible directions. 2010 called, they want their arguments back. Also, not sure if you've noticed, but Java is still in the top 3 of most in demand languages (along with JS and Python). Perhaps your ideas about its death are premature, if not deluded?
- ilovecaching 8y ago
- dragonwriter 8y ago> Java also took OO in so many terrible directions Java basically copied (and cleaned up a bit) C++ OOP of the time. Don't blame Java for any bad direction, it was following rather than leading.
- ilovecaching 8y agoI blame them both. No I don't really, there's historical context there, I only blame people who continue to push OO after 2020.
- StreamBright 8y agoYou know, libraries. Java as a language is pretty bad but the number of good libraries available is insane. You are not coming anywhere near with other languages with this. Also, many of the big data stack applications have Java as a primary language so the libraries are pusblished as Java libs first. As it was several times on HN people do not only chose languages they chose ecosystems.
- ilovecaching 8y agoAs the world around Java advances, people need libraries for different things. The question is, of all those libraries, how many of them do I actually need, which ones are maintained, and is it worth the cost of Java. Many languages, like Go, have first class seat in cross platform cloud and containerization that is hard to beat.
- jahrule 8y agoI think you meant Spring, not Swing, when talking about cloud frameworks. And from this it seems to me you are somehow biased against the java ecosystem without hands-on experience to base your opinions on.
- ilovecaching 8y agoEdited, it was a slip of the tongue.
- zmmmmm 8y agoIt's fascinating reading a post like this because I feel exactly the same from the opposite perspective. I feel bad for people trying to write in other languages and manually re-inventing dozens of features the JVM ecosystem just gives you for free. In many ways, the whole container-push has been essentially people trying to achieve what the JVM already gave you (isolation, cross platform, etc etc). I still don't see anything equivalent that doesn't impose huge burdens of complexity (which java does have but it's a known quantity with two decades of maturity).
- ilovecaching 8y agoThat's how much people hated writing Java. Also, Erlang would like to have a word with you.
- chii 8y ago> That's how much people hated writing Java. or, they are more concerned with shiny new tech rather than using a mature and well-tooled out stack that doesn't sound sexy. I for one, don't need sexy tech - i want my app's domain to be the shining star, not the tech stack.
- euyyn 8y ago> the whole container-push has been essentially people trying to achieve what the JVM already gave you (isolation, cross platform, etc etc) Google did containers in Borg many years ago, and many of its servers are written in Java.
- pjmlp 8y agoYep, WAR and EAR files with J2EE servers. When I stopped caring about POSIX.
- discreteevent 8y agoTwo things (among many) you will be missing when targeting WASM vs JVM: Garbage collection and mature profiling tools. Each of these is bigger than many language features in my experience for writing production software. I would gladly write Java 1.0 if it was the only way I could have them. But in fact I can choose anything from Scala to clojure.
- spricket 8y agoI'm not sure if you're trolling so I'll try to keep this short. Java is old, it's crufty. Yes. But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. The JVM is also extremely reliable. I've seen apps run for years straight. And the tooling is better than basically anything. Profiling, debugging, realtime code generation and modification. Libraries for anything you can imagine. ~4 solid IDE's. Java's OO is fine, and all the nightmare patterns died years ago. You only see them because Java has been around for so long. Modern frameworks like Vert.X or DropWizard are fairly nice to work with. Even Spring Boot isn't too bad. But Spring is dated and not often used for new projects. The JVM has extremely powerful built in monitoring API's that put any other language I know of to shame. WebWorkers are trash compared to Java's nice threading model. It even supports CPU optimized Atomics. There's nothing unusual about writing microservices in Java. V8/Node is just as "big" a virtual machine as the JVM except JS runs ~5x slower and takes 5x more ram. You can also write Lamda in Java. There's many valid critisicms of Java but yours are largely invalid
- ilovecaching 8y ago> But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. Fast is a poor word to talk about benchmarks between languages. Memory, throughput, latency are the things we should be talking about. There’s also trade offs where predictable scaling of latency under massive load is important (Erlang, Elxir), or spending less memory and starting up quickly in order to scale horizontally is important (Golang), or speed of development is important (PHP, Python), or correctness is important (Haskell, Rust). Java is rarely the winner in any area in favor of being well rounded, but as we should be using tools that meet at least the broad requirements it is always possible to make a better choice than Java. > I’ve seen apps run for years straight. This is why Java is dated. I am an Erlang developer, which is known for being hot reloadable and running forever. It turns out this model is actually juxitposed to Kubernetes and severless, which both presuppose letting processed crash at the host level and starting and stopping quickly. This also gets into the tooling argument because profiling in Java would rather the VM be long lived. > The tooling. I too have an operating system with great tooling, it’s called Linux. My knowledge of tooling is more broadly applicable, I can introspect any binary and attach probes to the kernel with bpf. Profiling for a VM is table stakes because you’re on your own. Not only do you have to figure out what’s going on in the JVM you also need to duplicate your effort to figure out how the JVM is running on the host. > Java OO is fine. OO in general is not fine.
- twic 8y agoWe should print out copies of this comment, and laminate them, and give them to anyone who thinks that comments on HN are good, as an educational resource.
- ilovecaching 8y agoLimiting personal freedom is what the enterprise Java ecosystem is all about.
- _khau 8y agoThis is why people are calling you a zealot.
- neeleshs 8y ago"One day Java will be like Cobol." I heard that one two decades ago about Java.
- dionian 8y agoI wanted to ask him how he felt about UNIX
- int_19h 8y agoTwo decades ago, Java was 3 years old. It's still true, though, but it's a compliment. Most languages have no hope of ever becoming the next COBOL. For Java, it is practically a certainty, even if Oracle were to pull the plug on it this very moment. It's too big and too important to die.
- pron 8y agoThe Java Platform is state-of-the-art in compilation technology, GC, and monitoring/management; nothing else comes close on almost any one of those, and certainly not on all of them combined. The alternatives you mentioned are all "good enough" for some use cases, but are technologically years behind the JVM. Some people are fine driving a Hyundai, but others want to drive a Ferrari. Besides, if you need to write some serious software that has to be performant and manageable and that you're going to need to depend on for years and years, there really aren't that many alternatives. That's why Amazon and Netflix and Google and Apple and Twitter choose Java to run all/most/many of their backend. Such large companies tend to use Java more on new projects as they grow (that's the case with Facebook and GitHub). It is true that for smaller, less demanding software, there are many alternatives, but except for a very short period (~2000-2005) Java never dominated that kind of software. Early on people used VB, FoxPro and Delphi for that stuff, and later PHP, Python and Node.
- gerbilly 8y agoThis seems a bit uncharitable. I still use Java a lot for application servers[1] and enjoy it. I've also used Go, but I wouldn't want to try and implement, say a non trivial REST server with it. I don't have the time to code everything from scratch, or to use an immature Go library or framework for example, when there are perfectly good ones in the Java world.[2] Perhaps it might be best to just see languages as tools, and that each language has a purpose. Java is old, so what? Lots of people derive value from it, and it's very stable. You might be glad that banks use it, instead of immediately jumping on whatever languages you mentioned above. At least it manages to do boring things like keep you accounts relatively safe from hackers. [1] https://www.dropwizard.io/1.3.9/docs/ https://www.dropwizard.io/1.3.9/docs/ [2] And yes, for that kind of application, unchecked exceptions are way more convenient than thousands of lines of if err != nil all over the place. And annotations in Go are an afterthought and it shows.
- pmoriarty 8y agoThere are a huge number of Java programmers who know very little if anything outside of it, who've geared their entire careers towards learning the Java ecosystem and don't want to learn anything else. There are also thousands of companies which are focused on Java, Java, and more Java. Many schools are also geared towards churning out more Java engineers, and people who don't yet know Java want to learn it because there are still so many Java jobs around. That's a lot of inertia to overcome.
- cutler 8y agoMaybe this is where Kotlin fits in.