45 ms·
Java Is Underhyped
- Jaxkr 5y agoThanks for the two upvotes so far! Please feel free to leave criticism of the article or my writing; I'm trying to strengthen my composition muscle.
- zodiakzz 5y agoYour jab at TS was lame as Java itself has complete type erasure for generics. >by crystallizing type definitions and guaranteeing type guards by default. Not so crystallizing if you know.. if you've ever used a Java List, Set or a Map. i.e., List<icouldbeanythinginhere>. such guarantee. wow. Honestly, I'd prefer TS with strict mode over Java any day because nullability is explicit, don't have to watch out for the dreaded NullPointerExceptions left and right.
- Jaxkr 5y agoThank you, good point. I forgot about HashMap's type unsafety even though I wrote the following monstrocity a few days ago to loop over a HashMap<UUID, ExpiringEntityPlayer> Iterator ghostI = hashtableNPCs.entrySet().iterator(); while (ghostI.hasNext()) { ExpiringEntityPlayer expiringEntityPlayer = (ExpiringEntityPlayer) ((Map.Entry) ghostI.next()).getValue(); } Apparently this is the only way to do it, and the Map.Entry type absolutely nukes any semblance of type safety.
- cesarb 5y agoYou are supposed to use generics: Iterator<Map.Entry<UUID, ExpiringEntityPlayer>> ghostI = hashtableNPCs.entrySet().iterator(); while (ghostI.hasNext()) { ExpiringEntityPlayer expiringEntityPlayer = ghostI.next().getValue(); } However, it's a sham. The generic types are stripped at runtime. The compiler will prevent you from putting values in the map that are not an ExpiringEntityPlayer, as long as you are diligent in using generics everywhere, and don't fall in the few traps where the wrong type can slip by without a warning, but you can still be hit by a ClassCastException at runtime if you're not careful.
- tpxl 5y ago> but you can still be hit by a ClassCastException at runtime if you're not careful. While it is true the generics are more or less syntactic sugar, I have never seen a ClassCastException due to this in all my years.
- twic 5y agoThis is exactly like saying all types in C or C++ are a sham because you can cast a typed pointer to a void pointer.
- oftenwrong 5y agoIn modern Java there are more terse APIs available. For example: hashtableNPCs.values().forEach(ExpiringEntityPlayer::something);
- baby 5y agoYou def. are doing well with both title and content, controversial stuff always has an audience. I would just recommend learning another programming language :)
- da39a3ee 5y agoI'm curious which editor/IDE you used while writing typescript? I've recently started writing typescript and I've been finding it more or less a mecca of good editor completions and LSP support, compared to what I was doing previously (Python in an old school editor) (I'm using VS Code for typescript).
- twic 5y agoOne thing to bear in mind as you read the comments is that the great majority of people commenting clearly do not have good up-to-date experience of working with Java. They're arguing against the Java that they used a decade ago, or perhaps even just repeating flames they read a decade ago.
- marcodave 5y agoThe INCREDIBLY VAST majority of people that are working with Java/JVM for a living most likely have never even heard about HN. And yes, there are countless shitty projects in maintenance mode maybe even written in pre-1.5 Java. If I were stuck in such projects for years I would also be super-bitter about Java
- internetrando 5y agoPersonally, I wonder if/when Java will become the next COBOL: nobody wants to learn it, feels extremely awkward and obtuse compared to whatever is current then, but there will be loads of old code that needs maintaining. Certainly feels like it's on that track now...
- marcodave 5y agowell I heard that good COBOL coders nowadays are recalled from retirement and covered in gold in order to maintain old codebases. It's not that bad :)
- offtop5 5y agoJava is under hyped in the same way Toyota Corollas are under hyped. Nothing is exciting about it since it's so common. I personally dislike Java since I just find it hard , you'll never want for work as a skilled Java developer
- Koiwai 5y agoThat's a great analogy, but I'm a bit confused about the later part, is it "you'll never be wanted for work as ..." or "you'll never want to work as ..."?
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- rbancroft 5y agonoun: want; plural noun: wants 1. a lack or deficiency of something. "Victorian houses which are in want of repair" In this case it's a double negative, OP means you'll always be able to find work as a skilled java developer.
- rbancroft 5y agook I'm wrong on the grammatical analysis, it's not a noun but rather an idiom meaning to lack or need something.
- Brian_K_White 5y ago"You'll never want for X" means you'll never need X, you'll always have all of the X you could want.
- Koiwai 5y agoI'm not good at English but shouldn't that be just "You'll never want X"?, "for" seems redundant to me. Anyway I looked it up, seems it's a legit usage, my bad.
- ntw1103 5y agoWhile attneding university, Java made an appearance in 4 different classes, the first two clases students take are Java classes. One interesting thing to note, is that for these classes, none of the students were allowed to use any of the Java libraries, or external libraries, everything had to be built from scratch. So I didn't actually learn about using external libraries or Maven until later when I started developing for Android. >"How many languages can you think of that meet the following conditions?" I think that dlang comes pretty close. The Dlang community isn"t super large, but I've found everyone I've interacted with to be polite and helpful.
- Jaxkr 5y agoI had the exact same experience in my C++ courses: no external libraries at all. But those are a PITA anyways, even with CMake. And I've heard good things about Dlang but I've never used it myself, I'll have to check it out some more.
- seiferteric 5y agoI have never been a java developer but I get the impression it is similar to C++ in the way that they were not that great early on in their history but have since been dramatically improved, but the old reputation persists to outsiders.
- oftenwrong 5y agoJava is poor choice as a language for teaching programming. There are simply too many irrelevant bits that will get in the way of learning.
- baby 5y agoSchools use it because it used to be the best way to get a job. Not anymore.
- askonomm 5y ago> Used to be the best way to get a job Java is the most in-demand technology in my home country, Estonia. Java also has around 800 open positions at any given time where I live now (Buenos Aires, Argentina). In fact, pretty much everywhere I've looked, Java is consistently one of the best ways to get a job simply because it has the most jobs available. HN favourites like Go and Rust? I haven't yet found a city in Europe that would have more than 10 job offerings for either of them.
- theamk 5y agoThere are a few reasons to avoid Java today. - The programs are very verbose for the functionality they provide. There are countless lines of getters, setters, and trivial constructors. While IDE helps to write them, it makes reading existing programs slow and frustrating. Lombok helps, but very few programs use it. - If you do want to use Java ecosystem, there is Scala. It also has strong type system, nice IDE support and big ecosystem of third-party libraries, but is much more expressive and easier to read and write that Java. - Finally, if you have to run medium to large java programs, you need to constantly tune the JVM. Unfortunately, you can't "confidently trust the JVM to do what's best" -- you need to get familiar with GC algorithms, manual heap sizing, GC tracing options and so on. Java still has plenty of uses because it has so much code written in it, but luckily, the new projects are using it less and less. I really look forward to the day when I can stop tuning -Xmx option in start.sh files!
- dbt00 5y agoIs the Scala language finally stable? I looked at it and discarded it multiple times over the last decade because every significant language revision required changing source code.
- MrPowers 5y agoIt's more unstable that ever with Scala 3 around the corner (which is basically a new language) and the May 1st Bintray shutdown that'll be massively breaking for the ecosystem. SBT builds were failing the other day from the Bintray brown-out cause all SBT plugins are still in Bintray: https://www.reddit.com/r/scala/comments/mph43t/sbt_build_failing_bintray_brownout_today_april_12/ https://www.reddit.com/r/scala/comments/mph43t/sbt_build_fai...
- jbluepolarbear 5y agoJava is fine; just fine. It’s not flashy or fun, comes with 25 years of CRUD, and so many ancient, enterprise codebases you’ll never run out of soul-sucking positions to bring your toolbox. Except they moved to the new hot CRUD framework and you’ll have to learn it all again.
- king_magic 5y agoThe sheer verbosity of Java is just unbearable when you're used to Python/Go/Swift/etc. No, Java is just about as hyped as it needs to be. Which is to say, it's more or less fine. Not great, not terrible. Middle of the road at best.
- eklavya 5y agoI am sorry, Go? That can’t be right. I even doubt it’s any more verbose than python or swift. You CAN make it verbose that’s for sure.
- da39a3ee 5y agoPerhaps verbosity isn't the right word, but having to put every function in a class (in a correspondingly-named file) feels extremely cumbersome to people who grew up with languages that just have functions and weren't exposed to Java early on.
- nemothekid 5y ago>You CAN make it verbose that’s for sure. No true scotsman? Even if you want to argue that Java CAN be made more terse, the vast majority of Java that exists today is incredibly verbose. Even running a Java program is verbose. Java is the only language I've used where it's more common to have a shell script that starts your Java program than just running ./helloworld. And yes, Go is less verbose than Java. Go might require some boilerplate, but it is certainly much less verbose than Java.
- LaserToy 5y agoVerbosity is not a problem in large code bases. Speed of understanding and debugging of what somebody else wrote is. So, less magic is better. I will take Java codebase over Scala or Python every time, unless it is a toy script which is 100 lines
- cle 5y agoEvery significant Java codebase I've worked in has had incredible amounts of magic. Between AOP, DI frameworks, APT, reflection, proxies, SPI, Lombok compiler hacks, dynamic classloaders, etc., there is a LOT of magic flying around and it can be quite hard to understand what will happen at runtime.
- api 5y agoJava was heavily hyped back in the 1990s and 2000s. It's still a decent language and has a number of things to recommend it, but today we have things like Go and Rust. I think it really fell out of favor due to Oracle's litigious handling of it. As soon as Oracle bought it I remember people actually cancelling Java projects and changing languages. Another problem is how complex and verbose it got. Original late-90s Java was pretty clean but eventually the ecosystem fell in love with enterprise style cruft and overengineered everything. It's less a problem with the language than the community though. Like C++, you do not have to use every pattern and language feature... but many people think you do and write ridiculously complicated verbose code.
- Jaxkr 5y ago> I think it really fell out of favor due to Oracle's litigious handling of it. Thanks for the info. Didn’t know this. I use AdoptOpenJDK and am grateful the free version is so fully featured. I’d imagine back in the day Oracle Java reigned supreme and their licensing terms were a real concern.
- api 5y agoI have heard about Java quite a bit more ever since Oracle lost against Google at the Supreme Court. I don't think that's a coincidence.
- twic 5y agoBack in the day, Java came from Sun, who were generally pretty cool about it. Oracle bought Sun in 2010, things looked okay for a year or two, then it started to get scary. The situation now is not scary: there is a community process to manage the language and library definitions, the JDK is open source, with Oracle contributing, there are other significant contributors (notably RedHat and IBM ... so now just IBM), and there are multiple freely-available high quality binary releases of the same source. It could potentially get scary again. If Oracle stop contributing to the open source JDK, and instead work on a closed-source version of their own, then it's not clear that there is enough developer power among the remaining contributors to keep things moving at a healthy speed. But then, if that happened, maybe users would abandon Java rather than pay Oracle, so it would be a suicidal move for Oracle. Or, if that happened, other contributors could step up contributions to hoover up customers from Oracle. But it's not entirely reassuring to be depending on game theory like this.
- vinceguidry 5y agoAh another new dev enamored with IntelliJ. You'd think one day they'd realize that it's the IDE they love, not the language. But in my observation, they never do. Reminds me of a rationalization I heard once about how people pick their brand of cigarettes. They all taste like crap until you're finally addicted, then the one you happen to smoke at the time is now your brand. Every new language / stack now gets compared to Java with IntelliJ because that's what they learned. Can't tell 'em any different.
- Jaxkr 5y agoA fair point, haha! I tried PyCharm recently (normally use VS Code) and I was really impressed. I think my emotions are misplaced: I might just like IntelliJ.
- vinceguidry 5y agoIntelliJ is nice, don't get me wrong. You can't really get a nice (for 2020) experience out of Java without it, because it's an absolute slog of a language. Just... so... much... ... ... ... everything. IntelliJ cuts through all that. You can get a nice for 2005 experience with Eclipse. Without an IDE, Java really falls down. Java is a phenomenal piece of kit, the amount of engineering that went into the JVM is insane. But people took the lessons from Java and put them into newer languages, that don't have the problems Java does that require an IDE. My love is in the language that IDEs don't and can't really add much to, Ruby. Emacs give me all I need.
- Hasz 5y agoIf you feel that way about Java, I'd love to know how you feel about C. Fast, runs everywhere, tons of interoperability, fairly compact language, your choice of compiler, etc. Also, congrats on graduating from CU! Just graduated last semester.
- bcatanzaro 5y agoJava: the worst of both the interpreted and compiled worlds.
- marcodave 5y agowow, 2021 and there are still people that think Java is interpreted?
- Nekorosu 5y agoJava is Criminally Omnipresent.
- LaserToy 5y agoJava is not hyped because it is a tool. Like a microscope, it just does what it supposed to do. IMO, if you want to get a descent job in a large company working on backend systems, you want to learn: Java, C/C++ or recently Go. You will be able to build pretty much anything, from a micro service to self driving car. If you want to stick to startups, you can do well with anything else till it growth, experienced engineers are hired and rewrite it in one of those languages.
- askonomm 5y agoThe "learn Go" part always puzzles me. In a city of 15 million (Buenos Aires), I can find about ~3 jobs for Go, but ~800 for Java. Clearly Go isn't going to be paying anyones bills anytime soon. At least not in this part of the world.
- baby 5y agoI always refused to work with C++/Java, and I managed to get a job with Rust at FAANG. If I can do it, you can do it :P
- LaserToy 5y agoWhy would any reasonable person limit their choices based on a tool? Rust or Blast - whatever I really don’t care what language I’m using if it it doing the job. I use Java, Java Script, Go, Python, Scala when appropriate.
- loopz 5y agoBecause it is most likely not your choice.
- Brian_K_White 5y agoYou just asked "Why would any reasonable person care what they spent half of their waking hours of their life doing?" The fact that you don't care does not make everyone other than you not a reasonable person. Frankly I don't see how any reasonable person could fail to develop some preferences, but I bet you would not like it if I called you unreasonable, or perhaps just unsophisticated.
- fallous 5y agoHaving been around in the 1990s, I can assure you that "underhyped" is the very LAST thing I think of when Java is mentioned.
- cesarb 5y agoI agree, my first reaction on seeing the title was "Underhyped? Really? You must be joking." The reason Java can be a nice language/runtime today is the sheer amount of resources available to be poured on it due to all the hype in the 90s. It was supposed to save us from all the effort porting our software to many operating systems and processor architectures (the computing world was much less homogeneous back then). It was supposed to run everywhere without modification, from the smallest smartcard to the biggest mainframe. It was supposed to not only run within our web browser, but also be the implementation language of our web browser, or even the whole operating system. It was supposed to magically be faster than even C and C++ (those who used Java back then can recall how slow it was; for instance, hanging the whole browser for a whole minute while the JVM started up was not uncommon). Everything was supposed be written in Java; it was not good enough to call a native library for whatever functionality you wanted, it had to be rewritten in pure Java. Java was a mediocre language. All that hype led to a virtuous cycle, which allowed it to grow into what it is today.
- sideshowb 5y ago> It was supposed to not only run within our web browser, but also be the implementation language of our web browser, or even the whole operating system Tbf with Android that came to pass, at least until the applet apocalypse
- qayxc 5y agoLook at their age. We've arrived in a world were young developers rediscover old tools and missed the time when Sun Microsystems brute forced Java down the throat of everyone. Heck, here were native Java CPUs, Java Smartcards and different editions like JavaME for what today is branded IoT devices. I cannot get the "write once - run everywhere"-slogan out of my head to this day. I don't even want to imagine a world where Java Applets actually "won" the internet and we would have proprietary multimedia applets instead of <audio> and <video> tags or even just CSS...
- mikl 5y agoOne word: Oracle. Given their insidious licensing and litigious nature, I wouldn’t touch Java with a ten meter pole.
- deleted 5y ago[deleted]
- SavageBeast 5y agoOpen JDK is pretty good now - Im migrating our prod env away from Oracle JDK soon. The smoke test env running Open JDK has passed all tests. No reason to stay on Oracle anymore. There are other JDK makers and they work great.
- cesarb 5y agoOpenJDK is pretty nice, it's the "CentOS" of the Java world. Which, given the recent events around CentOS, should give one pause. If Oracle ever closes the language again, will development follow one of these other JDK makers, or will they all trail the "official" Java like in the past (GCJ/Classpath, Harmony, and so on)?
- mjevans 5y agoI didn't see this when I wrote my reply under theamk's post about > There are a few reasons to avoid Java today. Hard agree, and had the same thought BECAUSE Oracle.
- hn_throwaway_99 5y agoI was a Java developer for about 15 years, then switched to Node and Typescript about 4 years ago. I think this author is going to be up for a rude awakening when it comes to the benefits of nominal typing, as this is the area that I couldn't disagree with more. I've commented about this before, but structural typing in Typescript makes it so much easier to refactor and to get one existing piece of code to confirm to another existing piece of code. Refactor projects in Java could sometimes literally take months when you had a major version upgrade from some important dependency and now you had to replace all your Foo1 objects with Foo2 objects, even though the interfaces themselves were largely the same. I just find myself sooooo much more productive in the Node/Typescript ecosystem than I ever felt in Java.
- frugalmail 5y agoI think the problem is the cohorts your talking about. There is the dimension of how long you've been programming and how large your software projects are. The folks that gravitate to environments like Java are usually in the high experience large software environment. The other quadrants typically gravitate towards the terse and rapid development platforms.
- baby 5y agoOh man, if you like Java power to you, but I refuse to work with that language.
- aprinsen 5y agoI didn't care for Java when I learned with it in school, found it verbose. Working with it as a dev, my opinion improved. A lot of the new FP inspired APIs make logic much terser, and the OOP stuff can make implementing certain architectural patterns very clean. The other great thing about Java is that nearly every conceivable question has been answered, as far as day to day development. Not so for newer languages. My biggest pain point with java is the type system. Like, you basically need to write or consume a library to work with tuples.
- fomine3 5y agoStream API allows you to write fluent codes until you met checked exceptions. I wish they had solved this.
- erik_seaberg 5y agoJava generics just aren't powerful enough to express that a higher order function's exceptions depend on its args, so pretty much everyone has given up on specific checked exceptions.
- twic 5y agoYes, they are: @FunctionalInterface public interface ThrowingConsumer<T, E extends Throwable> { void accept(T value) throws E; } public static <T, E extends Throwable> void forEach(Collection<T> elements, ThrowingConsumer<T, E> consumer) throws E { for (T element : elements) { consumer.accept(element); } } There is a significant shortcoming, which is that you can't catch exceptions using the type parameter - this does not compile: public static <T, E extends Throwable> Optional<E> forEach(Collection<T> elements, ThrowingConsumer<T, E> consumer) { for (T element : elements) { try { consumer.accept(element); } catch (E e) { // <-- not allowed! return Optional.of(e); } } return Optional.empty(); } You can kludge your way around that in various ways, but none of them are pretty.
- dcchambers 5y agoI do think Java has a bad rep as a "dry, corporate, enterprise" language, but I think there is an ecosystem around Java that is pretty awesome and you can build incredible applications with Java if you want to. Java has a branding problem. Java (and Oracle) missed the wave of the last 15 years when tech became "cool." If you were new to tech/programming and wanted to pick up a language, which of these three would you pick, based on the website? - Java: https://www.java.com/en/ https://www.java.com/en/ - Kotlin: https://kotlinlang.org/ https://kotlinlang.org/ - Scala: https://www.scala-lang.org/ https://www.scala-lang.org/ Java just doesn't have the cool factor that other languages have. A little rebranding could go a long way to reinvigorating the language in the eyes of newcomers. And I say that because the author of this blog post is a newcomer. Experiened developers know that, despite the ugly Oracle branding, Java is a good language with a sophisticated ecosystem of tools surrounding it. He seems to be mostly enamored with the developer experience of IntelliJ + Java + Maven. And while it is great, that experience is possible with most programming languages. Disclaimer: I haven't used Java since my early University classes 10+ years ago.
- Jaxkr 5y agoI actually laughed out loud at the Java.com homepage. I was so surprised, I expected a sleek, modern homepage but instead I got a portal to 2010.
- systemvoltage 5y agoTo be fair, lots of websites were far better in 2010 than today’s white space filled, massive typography, bright colored potpourri of rounded corners, scroll jacked bullshit. Full screen, infinite scroll, hamburger menus. So many awful contemporary design choices. Don’t pool it all together with this Java website - which sucks but not because it was from 2010. I abhor and loathe modern web design.
- Jaxkr 5y agoI love old web design too. Sometimes I go look at 2007 WorldOfWarcraft.com on Archive.org to enjoy old design. I just remember the Java.com homepage from visiting it in computer lab in 2011 so I could play Minecraft.
- Koiwai 5y agoI'd admit it is very successful, since C++ already existed, it's a commercial miracle. But if you're still promoting Java in 2021, I'd say you're very shortsighted.
- ncmncm 5y agoBeing excited about Java is like being excited about dirt—not any particular dirt, just dirt in general. Yes, practically everything that grows grows in dirt, and anybody can walk on dirt, and in a pinch you can throw it at people or dig a hole and crawl in. Dirt. Java was designed by people who had absolutely no intention or desire to ever use it. They cribbed parts from other languages they didn't really understand, and changed details in ways that make no sense on their own, or with other things they changed for actual reasons. Their estimation of its expected users was very low, so they made everything dull and squishy so nobody could do much harm whether by mistake or deliberately. It got billions of dollars more hype than it deserved on merit. Its privileged place in the corporate world, like its good tooling support, are direct products of that hype. The hype it got on first release, beyond the (very large amount of) money backing it, comes from a peculiar twist of history: right then, millions of programmers were sharecropping on Microsoft's plantation, and saw Java as their 40 acres and a mule. It was a balky mule, but it promised freedom from switching to a whole new app framework literally every 2nd year. Since then, a very large number of libraries have been made to package most common operations. It's barely adequate for making libraries, but people have put a great deal of effort in because of the big user base. "I enjoyed programming in Java, and being relieved of the responsibility for producing a quality product.": <http://blog.plover.com/prog/Java.html http://blog.plover.com/prog/Java.html>
- aryehof 5y agoI think that Java is more like “concrete” than dirt. Fairly gray, unexciting and utilitarian, but nevertheless much of the world is reliably built on it.
- ramoz 5y agoI align with most of these purists. But I don't think the verbosity matters. Its not a bottleneck when you're using Java because you shouldn't be in a position to care about such things. Hell, it's probably beneficial in the extensive SDLC you're probably working in. Sure, java has its place and enables fine productivity in enterprise dependent workloads & scale; but that scale's complexity is often nominal, because what's unique about a traditional java-based system? Why would you use Java to be unique... the jvm is perfectly magical? nah. Don't generalize engineering, lol, "feels good"... I think you mean "personally comfortable" which is what the oracles and jet-brains want you to feel. There is no art in java. I'd struggle to invest so deeply or engrain myself in an enterprise setup vs whatever personal/business circumstances Id be in that situation. If you really want to be hip in that type of world go .NET
- MrPowers 5y agoJava has gotten better over the years (borrowing good ideas from Scala) and is maintainable. They make a huge effort to keep Java backwards compatible, even across major releases. I depend on some ancient Java libs and they still work just fine. It's a huge relief when major version bumps don't break everything.
- NuSkooler 5y agoAh, someone who wasn't around to see the years of real Java hype. I've had to work with Java professionally for a number of projects over the years, and honestly the only use for it I've actually agreed with as "good" is on Android -- and as we know, Google tweaked it, battles ensued, yadda yadda ...and even they are moving away from it. The shitshow that owns it is good enough to avoid it, let alone the language itself.
- zerotolerance 5y agoSpeaking as a near 20 year Java programmer, Java is criminally bloated at every level. The ecosystem has been covering for its shortcomings since y2k. That ecosystem is so thick and full of abstraction that no two devs from different framework backgrounds would recognize the others code as Java. And the abstraction... it is a language for people who are more interested is the abstractions than actually getting things done.
- tirrex 5y agoI agree with you. Actually, Java has great tooling, JVM is very nice, it has great potential for high performance code generation. It has everything for debugging. But at the end of the day, language is driving people to write bloated software. I just wonder, how come e.g Linux kernel code 100 times more readable than any project in Java? More importantly, how did we come to this point that we accept bloated/unreadable code in the name of higher/better languages?
- loopz 5y agoJava won by its portable deployment model, stack traces, GC, libraries and security sandbox safety. In over two decades, very few other platforms have come close to its promises. C# is perhaps much better, but has stronger proprietary ties and vendor lock-in. Java became overcomplicated by frameworks and design patterns, so has always felt bloated and slow. But has worked best for business logic. Though is maybe behind COBOL thus far, and tends to hide/obscure logic. No two java designs looks the same, scales well or converge to clear consensus. The language did lower the bar for what cheap programmers could accomplish faster though.
- benbristow 5y ago> C# is perhaps much better, but has stronger proprietary ties and vendor lock-in What vendor lock-in? The whole thing is open source from the compiler to the runtime - https://github.com/dotnet https://github.com/dotnet If anything Java is more locked in as the most popular and 'official' runtime/devkit (Oracle Java/JDK) is completely closed source.
- Igorvelky 5y agosorry long sentences are not my forte ## python comprehensions, better then java or c++ way . which is absolutely same . so java === c++20 (ms way) . https://calmcode.io/comprehensions/example.html https://calmcode.io/comprehensions/example.html (not affiliated) ## jupyter lab your data and your processing is on same machine potentially remote, nas, privatecloud... so you can do things on your data without unnecesary bs from browser with youbikey, google titan auth. ## neovim because... well, dont be negative and treat it as fedora for your redhat (vim) (yes i remember, im that old) ## little bit of trolling do this on your brand new mac in vscode ... yes, he has fingers https://www.youtube.com/watch?v=-I1b8BINyEw https://www.youtube.com/watch?v=-I1b8BINyEw ## Java is good for Transform UML to code. thats it, DONE. ## AI ! ! ! ! XOr Not Btw who said machine learning can code for you ? uh, me not! Lets draw pictures for ML, to have better MS Office! https://knowyourmeme.com/photos/1845265-back-to-the-future https://knowyourmeme.com/photos/1845265-back-to-the-future
- rektide 5y agothe verbosity complainers have no idea. they're just way off base. writing some jax-rs or what not is so compact, so simple, so easy. I can't begin to understand these complaints given the get started cost of any alternative, all the js frameworks, elm, swift, whatever. java's magic annotation systems are wonderful & concise.
- gilfoyle 5y agoJava language gets its hate from its historical lack of focus on developer happiness. Beyond the language, the crufty experience with Java Bean, Java EE, WebSphere era all contributed to this. Thankfully, Java ecosystem has learnt from other languages and frameworks and with Java 8 onwards has addressed some of major pain points For e.g. lambda, streams, vars, text blocks, records etc, On the other hand, Shopify and Dropbox that used Ruby and Python heavily had to invest in type checking to bring back some sanity and this is evidence that beyond a size of code base, static type checking is worth it. Considering these, I find Java to be a very good option to build stable enterprise applications compared to Ruby or Python.
- hn_throwaway_99 5y ago> Considering these, I find Java to be a very good option to build stable enterprise applications compared to Ruby or Python. Which is honestly why I think Typescript with Node on the backend is an excellent choice for many enterprises.
- drdude 5y agoI prefer Scala, even more elegant and expressive... not to underestimate overuse of its features leads to confusion hell.
- ch_123 5y agoReading between the lines, I feel like the author (who admits that they are new to the industry) is placing too much emphasis and value on certain technologies having "hype". This is reasonable - I also was a bit like this when I was starting out in my career. I feel like the takeaway the author should have arrived at is that hype comes and goes, and doesn't really correlate with whether a piece of technology is valuable or not.
- gorjusborg 5y agoExactly my thought as well. It's following the hype that steered him wrong in the first place. Over time, I've found myself more interested in tech that sticks around. There's usually something to learn from it.
- popypooping 5y agoThe guy was changed with a niggres, hey it is updated
- hutrdvnj 5y agoJava is great, because it is not worse at anything.
- k__ 5y agolol, Java was overhyped for quite some time. It even did deliver at the beginning, but then it stagnated. Now, it's just bloated. The syntax, the programming model, the package manager, the runtime. If you look at systems like Eclipse and Jenkins, even the software developed with it seems to go that way.
- Laremere 5y agoI read this post far more as "JS/TS are overhyped" than "Java is Underhyped". Javascript is a mediocre at best language which has been thrusted into the limelight by the fact that it's the language of webpages. Some people have decided that they want to write the same language everywhere, so they started using it for the backend. The points listed in the article for why Java is great apply to many of the workhorse languages in the industry today.
- philonoist 5y agoOff tangent: Is C# hated for the same reasons people here dislike Java for?
- pjmlp 5y agoKind of, never touch anything made by M$. /s
- jariel 5y agoIt's not perfect for anything but it's very robust and dependable. The API's are comprehensive, well thought through, to this day it's bizarre nobody has copied Javadoc. Python docs drive me mad. For a script - Python. For the web Typescript. For low level C or Rust. But Java is quite powerful for anything that stretches in between: not the fastest to write, but generally fast, the tooling is robust, the performance is quite good usually. And I love that it's uncool.
- dragonwriter 5y ago> to this day it's bizarre nobody has copied Javadoc. JavaDoc-style structured documentation in comments with toolchain to generate user docs from a combination of the comments and the associated class/method/function signatures has been widely applied; Doxygen and JSDoc obviously owe a lot to it, as do Sandcastle (for .NET), Rdoc/YARD for Ruby, Sphinx/autodoc (for Python), etc. I’d be surprised if there is a major language today for whuch there isn’t at least one JavaDoc-inspired documentation generator.
- patrec 5y agoI think Rust also meets all the criteria the author lists, probably Kotlin too, and arguably even Typescript (the quality package manager is a bit of a stretch, but I suspect the nominal typing the author hankers after can be emulated well enough to do the trick e.g. https://www.typescriptlang.org/play#example/nominal-typing https://www.typescriptlang.org/play#example/nominal-typing). As to the reasons Java lost its hype: Enterprise baggage and Oracle; the terrible startup times and long GC pauses probably also didn't help (even if there has been a lot of progress in this area in recent times).
- bni 5y agoThe reason Java is so disliked is because new developers first contact with it is maintenance programming on the horrible J2EE/Spring monstrosity that has evolved since 2005, or from even earlier.
- RamblingCTO 5y agoI feel like the arguments would've been better applied to kotlin (especially with IntelliJ). Java has two big problems: Null and boilerplate code (getters, setters etc.) which messes with code coverage (and no, lombok is no appropriate solution to this). Kotlin is pretty null safe and has very little things which we cannot properly test. The language is easy to learn and fun to write. It feels sleek, modern and you need to write less code than compared to java. You still get the whole ecosystem and can even migrate file-by-file. We actually still have a mixed codebase with 30% java and 70% kotlin (rough estimate) and it works wonderfully.
- kaba0 5y agoHaving 100% code coverage just because is not meaningful in itself, so I don’t see your point. Having 100% is just as not enough because you can arrive at a line of code from exponentially many states. Mutation testing is a good way to show whether the tests are actually worth anything.
- RamblingCTO 5y agoYou misunderstood me. You would need to add tests for getters and setters to guarantee that there's no typo in there (I've seen quite some bugs due to this) but it feels like a waste of time. That's why I'm happy that that's not necessary with kotlin. Code coverage is just a control tool.
- slver 5y agoI think the author is still forming their opinion on those languages. Several of their points sound wrong. "Dependency heavy workloads and industry trends" The author complains about JS having small packages about trivial things (and for some reason when people talk about this they always mention lpad, apparently lpad is the only small package in NPM /s). And about the fact Java has a type system. Many languages have a type system. In fact JS also has a type system through TypeScript. "Nominal typing" TypeScript typeguards are compared with the lack of Java typeguards. - Java has typeguards and they're even being extended: https://openjdk.java.net/jeps/394 https://openjdk.java.net/jeps/394 - Type guards have nothing to do with nominal vs. structural typing. They're rather used to disambiguate unions. If you have no unions you need no type guards. - Interfaces in TS are structural, but classes are nominal. Typeguards can be either. "Removal of responsibility for optimization" The author believes Java frees them from memory management and multithreading race conditions, and the need to optimize (like think about underlying data structures, algorithms etc.). Java reduces memory management concern relative to C++, but you still have reference leaks, you still need to free resources like file handles, connections etc. Also Java is no different than JS, C#, Python, etc. in that regard. Java DOES NOT prevent race conditions. Java DOES NOT mean you don't have to optimize. ------------- All in all this reads a bit like a JS developer who just discovered Java and is excited. That's good, but my conclusion is Java isn't underhyped. Or overhyped. It's hyped just about as much as it needs to be.
- cnity 5y ago> Interfaces in TS are structural, but classes are nominal. Typeguards can be either. Is this true? I might be missing something, but this snippet to me suggests otherwise[0]. [0]: https://www.typescriptlang.org/play?#code/MYGwhgzhAECyCeBhcVoG8CwAoa0wC5oA7AVwFsAjAUwCcBubXCwiAFxoEsiBzBrR6MAD2RNjRLBWQmgAoAlOgG5WACw4QAdGGgBeaAEYADH1zK1mirugAiABJUQIIdYEBfbO-5YAZiSKSOEWhWMABrKggEZEgIGTIkFAhCKMSFTBxBEQghECoNJ24ZAHJLdWgigBpoeOioDQo5Pk9sYVFWYiFWFJirdNwCAwqBZhsAFXNoMqJOjrIuMEd4PDgEmKqKEnaOLZgxCVYSGgWQeBcsZqwQ8MjVqBlprtuIRqA https://www.typescriptlang.org/play?#code/MYGwhgzhAECyCeBhcV...
- slver 5y agoSorry, you're right. I was thinking about "instanceof" which is a native JS feature, and it matches classes nominally.
- jiriknesl 5y agoI think, there are three things in this one. JVM, Java itself and how it is used. JVM is great. I think it gets a lot of love (in comparison with .NET Core which is IMHO as good as JVM). In this one, you see JVM everywhere except desktop apps. Then, there's Java itself. As a language, it really isn't as modern and doesn't provide much what isn't already available in C#, Scala, Kotlin, or even PHP or TypeScript. And it doesn't provide some things that other languages have. So on this scale, once you know Java, you can be productive, but I doubt you will be more productive than someone who knows C#, Scala, etc. And then, there's Java culture. Plenty of Java devs (mainly in J2EE, Spring world) don't develop in classes, they develop in design patterns. AbstractFactoryStrategy, complete abstracting out databases, five layer data models, classes for things that should be enums. It's a matter of taste, you don't have to do it (Android devs don't do this that much even when they use Java). And I think all the coolness of modelling, UML, etc. is over. I think, you can be productive in Java (if you use it a bit like PHP). I think JVM is fantastic. For me, I am 8 years in Clojure world and I wouldn't go back to design patterns, writing (in Java often generating) dozens of lines of code just to insert something to the database (entity, mapping, repository, business logic layer, etc.) when in Clojure, this would be three lines (defn, schema check, insert).
- strictfp 5y agoI left Java due to the culture. I actually think the core language is great. And under Suns management Java was largely what golang is today; it was the pragmatic choice and it put the focus back onto writing code and away from complicated language features. Then IBM stepped in with JEE, and it completely transformed Java into a language for bureaucrats and over-complicators. JEEs ethos was that the programmer is stupid and that the framework saves the programmer from their own stupidity. Not the greatest of ideas if you ask me. Sane people jumped to newer languages. I tried to stick around and argue against bureaucracy, but in the end I realized the pointlessness of it all. Now I'm ironically back with c++, but still the community is much purer and focusing much more on actual coding than snake oil. Still write Java on my spare time and love it for it's relative ease of use, speed, and clarity. Not the most portable, ironically, but my language of choice for prototyping. Java still has some true high quality libraries in it. I'm yet to find a good replacement for Doug Leas concurrency libraries in other languages. And the containers are great. And despite all the flak it gets, I actually think Swing is really good for whipping up a simple UI.
- praptak 5y agoI remember when Java had the hype - Virtual Machine! WORA! Runs in your browser! Your microwave will have Java! That was around my 3rd year in CS at university. A few years passed and I got to program in Java in a commercial environment. It was J2EE 1.4. It was bloated, had a really heavyweight and crappy ORM (JavaBeans? Active Beans?). As a framework it sucked. Also it was boring business applications, the cool kids used Python at that time. Just my personal snapshot of how Java lost the hype for me - crappy "dozens of layers" framework and an unappealing niche.
- twic 5y agoEarly Java EE was astoundingly bad. It's vastly improved now (from EJB 3 onwards), but still not wonderful. In one job, i used an enterprise framework that actually predated Java EE. Several ideas in EE were copied from it. But incredibly, this framework was substantially better than early EE. I believe, because that framework was built by people who actually needed to ship products to customers to pay their bills, which limited the amount of overcomplication and obstruction they could get away with. There was no such limit on Sun's architects.
- praptak 5y agoJava the language has also improved since that time. Pre-generics Java was pretty bad. Unlike Go (whose creators obviously had decades of history to learn from) there weren't even any baked-in polymorphic types.
- vardump 5y agoJava (and JVM) sure has its advantages. And I enthusiastically advocated it in the nineties, when no one seemed to see its strengths. It was simple, performed well (other than GUI and classloading sometimes took a minute) and was very portable. I even wrote some demos in it in the late nineties to show it can actually do 60 Hz realtime graphics. Over time, the ecosystem got pretty strong. JVM improved and the performance got better. Life was good. But something bothered me. Those crazy dependencies, how everything was overcomplicated. Perhaps JVM got too good at optimizing and monomorphizing abstractions away? You didn't have to pay performance penalty for complexity anymore! Worse, all these layers of dependencies and abstractions made it nearly impossible to actually understand the whole system and figure out root causes for the issues other than by using arguably fairly mature and good tooling available. All this made me puke. So I stopped coding in Java, maybe 2005 or so. Haven't looked back. Nowadays I'm happy developing things where Java doesn't stand a chance. Kernel drivers, bare metal firmware, tricky low level stuff, vectorized high performance code. Things that just can't get bloated or they might not work at all. I don't have strong feelings about JVM much anymore, as long as I don't have to touch it. JVM's high power consumption bothers me though, we're wasting so many nuclear powerplants worth of power for pretty much nothing. Of course the same is true for many other high level languages. Perhaps we should work on high level languages with low power consumption?
- kaba0 5y agoActually, the JVM uses comparably less power than other high level languages. And frankly, you simply can’t write all the software in use in low level languages. Yeah, it is theoretically possible but not feasible
- vardump 5y agoI agree on both counts, but my point still stands that having a high level language with low power consumption would be great. Don't ask me how to create one. But perhaps someone who sees this has some ideas that gets us started on this path. You never know. Power consumption doesn't get enough attention from software developers.
- habosa 5y agoI haven't been coding as long as most (about 10 years) but I've had phases of Java, Ruby, Python, JS, TS, ObjC, etc. If I go onto my GitHub and try to get any of my old projects running I am extremely confident that the non-Android Java ones will still work. All of the other ones will probably have "rotted" over the years and send me down a day-long rabbit hole looking for old dependencies or build systems. There's something to be said for that amazing stability. I can't think of another language where you can find some .edu page from 2001 with a link to a library (.jar) that does what you need and you can actually use it in a modern application.
- jerven 5y agoThis, so much this. The value of code just working and staying working is humongous. Having code that is unchanged from Java 1.3 doing it's thing and delivering value 21 years later without needing to be touched and revisited allows us to focus on improving the code that needs to be improved. Doesn't mean we don't touch old code (change idioms, generic safe, build process etc). It means we do it when there is value to us for updating it. Not because we are forced to due to an infra change. At the same time code that ran on a PA-RISC machine now happily runs on a mac arm (even then it was great because the same code ran on PA-RISC, powerpc, x86 and X86-64). If that code was written in python it would have likely gone through two breaking cycles at least. C sure that would have worked but the cost of having it working such a variety of systems would have been humongous for a small group like us. What real alternatives have this claim? C++ chances that I can compile code from 2000 without issues is minuscule. Sure I had my EJB "fun", and when I look at some of the micro-services being deployed I see the same problems. Because they are reflections of organizations. (i.e. sometimes have the feeling that changing language in an org is like switching your in-office communication to Italian, because it so fast and romantic.). Just because there was "bad" code written in the past doesn't mean new code is done that way. Yes it exists, yes it needs to be poked once in a while, but that is a lot cheaper than rewriting in a modern style.
- qayxc 5y ago> C++ chances that I can compile code from 2000 without issues is minuscule. Really? I have code from the late 90ies and it compiles just fine. Do you perhaps mean dependencies? Because the issue there is the completeness of the framework and libraries around Java rather than the language itself.
- nonbirithm 5y agoThe amount of vitriol Java receives in the game development space is rather strong. However, whenever people dismiss Java as being a bad language, I can't help but think of Minecraft. Yes, it's one of the few mainstream titles where Java has been successfully applied, but I believe Minecraft's success was specifically because it was written in Java. With no JVM, there would have been no Minecraft mods at the level of flexibility that Forge provides, and the game would probably have stagnated in comparison with the sheer amount of community content from the past ten years that's available. Being able to use libraries like ASM that allow you to transform the compiled bytecode in radical ways were possible only because Minecraft targeted a virtual machine. The incredible thing was that this was in spite of the obfuscation Mojang applied to the compiled source. If it was possible to create a flexible mod system at all thanks to the JVM, people were just too motivated for any deterrence to stop them. For the people who say that Minecraft should have been written in C++ or something from the start, because Java is a mediocre programming language, there's Bedrock Edition. Nobody I know cares about it enough to play it. For all its bloat and performance issues, the benefits of the JVM were simply too convincing.
- slver 5y ago> The amount of vitriol Java receives in the game development space is rather strong. Java is a language with mandatory GC, tiny objects scattered around the heap (poor locality), and no value types or low-level memory access. This makes it very poor for games (you know, other very basic ones). But they're rapidly addressing these concerns.
- chii 5y ago> no value types or low-level memory access. i dont think you need value types at all, and you can simulate it by using byte buffers with an abstraction on top of it. After all, what's the difference between value types and a byte array? As for things like low level memory access - you also don't need that in most cases. Graphics libraries will give you enough access. And for any other case, you can always JNI into native code, or call any existing system calls or libraries. Interop between java and native is not that bad (cumbersome for sure, but still possible). The only reason java gets poor performance is the coder doing java is too used to producing garbage (or is too inexperienced to write high performance java code). you can easily avoid most performance problems in memory by pre-allocating and reusing memory by pooling. These techniques are already commonly employed in C.
- thiht 5y ago> Java is fun to write, productive What the hell? I don't think we have the same definition for any of these words. I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Not to mention the pain point that it still is to install and configure a JDK, and make it work properly with Intellij, why is it still so complicated? Then there's Maven and Gradle that are just... bad, I have no other phrasing. I hear a lot of people saying Maven already solves all the problems we have with today's tools but that's just not true, even the entire Maven stupid lifecycle should be thrown away!
- scaladev 5y ago>Not to mention the pain point that it still is to install and configure a JDK, and make it work properly with Intellij, why is it still so complicated? IDEA can download and configure one of multiple JDK distributions in a single command: https://www.jetbrains.com/help/idea/sdk.html#jdk-from-ide https://www.jetbrains.com/help/idea/sdk.html#jdk-from-ide
- Twirrim 5y ago> Not to mention the pain point that it still is to install and configure a JDK, and make it work properly with Intellij, why is it still so complicated? I used to work for a company that had about 100 different Java web applications running, each with their own JDK. It was _trivial_ to set up and maintain. Was it wasteful? Sure. I shipped a JDK with each application. Was it hard to automate? No. Basic deployment automation made it trivial. The JDK was just an application artifact alongside the JAR file, and the application starting script set JAVA_HOME pointing to it for that process. IntelliJ makes it trivial to maintain a project specific JDK. You just add the location of your JDKs to it (IIRC it can even auto-populate the list), and then choose the JDK from a simple menu within the IDE.
- twic 5y agoInstalling a JDK is trivial. What do you mean by "configure" a JDK? You mean tell your IDE it exists? Wow.
- BiteCode_dev 5y agoFor my use cases, Java has all the wrong compromises: - not high level enough to compete with Python/Ruby/JS/PHP, etc - not low level enough to compete with Rust/D/Nim/Zig - not specialized enough to compete with Erlang/R/Go/Julia - not opinionated enough to compete with Lisp/Haskell So why use Java ? It's good, it's fast, it's productive, it's well supported, battle tested and documented for decades with a huge pool of devs. And many companies already use it and the tooling is excellent. But those are not sufficient reasons for me. Python is older than Java, well supported, battle tested, documented with a huge pool of devs. But it's way better for high level stuff, data mangling, scripting, gluing, and for most web dev stuff. If I want a distributed system or something with a lot of I/O, Erlang and Go will always be better than Java. Sure, they are less widespread, with all the stuff it implies, but for such a nice need, I will pay the price hapily: my goal is optimization for the use case. Same for stuff that needs to go fast or have a small footprint, I'm not going Java if I can go Rust. If I want to have fun, Java is out of the loop. Better sharpen my inner weirdness by fighting with some exotic lisp. Why try productive ? I wanna enjoy myself, not run a business. So Java is not a bad choice. It's an excellent tech. I just don't have a use case for it.
- christkv 5y agoKotlin solves most of the problems for us while leveraging the benefits of the JVM.
- BiteCode_dev 5y agoJVM != Java. We are talking about Java as a language, not the JVM as a platform. You can also run Python on the JVM. Although, some Java compromises are definitely linked to the JVM.
- KptMarchewa 5y ago>You can also run Python on the JVM. Jython is stuck on 2.7 and unmaintained.
- 5y ago
- thrower123 5y agoPretty much anything general purpose that I might want to use Java for, I can use C# instead, and I like it better. Cross platform support used to be the trump for Java, but DotNetCore/5 works on Linux and has nearly everything ported over now.
- shock 5y agoWhat IDEs exist for Linux that are free and on par with Eclipse for Java?
- thrower123 5y agoI don't much like Eclipse, but it's a fair point. Rider is really good, better than Visual Studio in most respects even, but it does cost about $100/year for a personal license. There are some programs JetBrains offers for free licenses though. VS Code is also an option, albeit much less powerful.
- boyadjian 5y agoFor me, Java can be very useful for amateur game programming, especially using IntelliJ. You have libraries like LWJGL, that are very powerful, and much others like ODE4J
- bluetomcat 5y agoJava is undermined by the orthodoxical OO culture around it. As a language, it's a pragmatic one with no fancy features to get excited about. Similar in design philosophy to Python or Go. What ruins it is its conservative dev culture stuck in the OO craze of the late 1990s.
- maxehmookau 5y agoI totally agree. I learned Java throughout my entire first-year at University (CompSci 2009) and it gave me such an excellent grounding in how OOP works. I don't use it day-to-day in my work anymore, but the principles I learnt were definitely useful!
- deleted 5y ago[deleted]
- Lapsa 5y ago"Type guards are my least favorite TypeScript feature. They're essentially duck typing that you have to implement yourself and trust that they're implemented correctly." Amen
- da39a3ee 5y agoI was surprised to find out that so many of the "software architecture" books are not about how to architect backend ecosystems comprising multiple communicating services, but instead are about patterns to use to organize large java codebases.
- CodeGlitch 5y agoAnyone interested in modern Java should listen to their podcast: https://inside.java/podcast/ https://inside.java/podcast/ (I'm not affiliated - just someone coming back to Java after 20+ years of C++ and Python). Recent stuff includes: * Vector API * Record classes * JDK Flightrecorder * Java 16
- kryptiskt 5y agoNo other language has ever been hyped to the degree that Java was back in the day. The marketing was relentless and every month some new Java-related thing was going to change the world: thin clients, Java Cards, Java browsers, Java office suites... We will never see its like. There's no money in programming languages anymore, no one would drop the kind of cash on pushing their pet language that Sun did back in the day. What I'm saying is: Java have had its hype and should settle in for a dignified middle age rather than try to hang with the cool kids.
- brutuscat 5y agoNot sure how things are now, but I would rather use Ruby via JRuby and still benefit from most of the Java ecosystem but using the much more higher level abstractions of the Ruby lang. Many years ago I discovered that I could use all the Java components just like that: https://speakerdeck.com/brutuscat/jruby-experiences https://speakerdeck.com/brutuscat/jruby-experiences
- throwaway10110 5y agoWait till the author discovers Kotlin his mind will be blown Kotlin should have called itself Java++ imho, that would help adoption in enterprise where managers might not know difference with Java
- stephankoelle 5y agoI know Hacker News doesn't like java a lot. I just want to speak up: I love Maven, Wildfly, IntellyJ and JAVA. Kudos to the brilliant minds behind JAVAs evolution: Brian Goetz and Mark Reinhold.
- abhi_kr 5y agoI have programmed in Python, Ruby, JS, C, Go and Java. The main reason Java receives so much flak is because it's setup is not beginner friendly. JS, Python, Ruby make it so much easier to just write a program and run it. Naturally, any novice programmer would quit Java in the setup process itself. It's not easy in Java to just write a program and run it instantly. But once you are through that painful process, there is no other ecosystem more stable than Java. Things don't move too fast and that's a good thing for production applications. I do dislike the verbosity sometimes while doing something that would take just a few lines in python or ruby. But IntelliJ more than makes up for it.
- monster_group 5y agoI vividly remember writing my first few Java programs. It was the most ridiculous thing to get it to run. JRE can't find the program when both the source and class files are right there in the directory where you are trying to run the program from. You have to set the classpath first else it won't ever find your program. A beginner would be definitely frustrated. I was. I earn my livelihood writing Java code but I have recommended Python to both my brother and son who are just getting into programming.
- stunt 5y agoIt's more accurate to say that "JVM is Underhyped". I think more people will agree with that.
- js8 5y agoThe ultimate problem with Java (and OOP too, even in the Kay's sense) is that its philosophy represents a very paternalistic approach to software development. The idea is here are these things called objects, you can't look into them, and you only have to use them the way they are designed; under no circumstances you can break them down into internal components and remix those freely. In Java, this overall approach manifests in myriad of different ways: - Functions and data are tied together. It's difficult to create new functions (methods) that operate on existing data, you have to inherit, and even that avenue can be closed, even indirectly because you find that you cannot actually get to some internals. - Interfaces are tied to objects. You cannot explain to the compiler that a given class actually supports a certain other interface in the way YOU define it. - Everything is a reference, no value types. No need to worry about the intricacies of cache management, we will handle that for you. - No need to worry about CPU optimizations or memory management either - we will do that for you, without an escape hatch. - You cannot change the existing operators to introduce more convenient syntax, because I said so. Any kind of "macro" - code generators, compile-time checks, conditional compilation, DSLs - forbidden. - The class and package hierarchy determines the access to its components. No way to override this from the outside, no way to expose things that are hidden. Worse, this is implicit, for example, class method accesses an object attribute, where taking a parameter would be more convenient; this hurts reusability pretty badly. Some of these shortcoming are only now being addressed, because people actually need to do these things anyway, in certain situations, which leads to proliferation of patterns and magical code generators.
- fsociety 5y agoThis so hard. I’m fearful when I hear things like Java being under hyped. Do people think this is the pinnacle of what software development is today? I think it’s made worse by the fact that you can program in another language, in a shitty codebase, and walk away saying “wow that language is very painful”. When in reality, it could’ve been the codebase and not the language. I see a lot of “but look at this successful project in language X”. Okay sure it was successful despite the language. Programmers are smart, we can make things work. Philosophically forcing developers into having to program in an OOP style, as opposed to having it as one of many tools, is a cardinal sin in my eyes. Same for forcing reference types. I’ll argue garbage collectors are bad too, but tbh that is more of a debatable topic.
- legulere 5y agoC# is a better Java and nowadays is cross platform and open source.
- The_rationalist 5y agoAnd so is Kotlin!
- eurasiantiger 5y agoThis reads like it was written by someone with Stockholm syndrome.
- de6u99er 5y agoJava is boring because its mature and just works. Plus many have a problem understanding how to do proper OOP.
- rock_artist 5y agoLanguage opinions are fun :) I'm actually old enough that Java was my main language during CS. No Python... Before that when I during my teenage years I got to lecture by some senior in IBM that showed how amazing is Java and it's the future. (That was 10! Years before I've attended) And that's that's the thing... Hype is all about "new" things. And after a while it dusts off. HN had a lot of posts about good developers. usually it sums up as problem solving and human relationship. Never I saw a good developer of language N.
- sodality2 5y ago>I'm actually old enough that Java was my main language during CS. No Python... Is java considered old or outdated for today in CS? I'm learning Java in my AP computer science class to this day.
- rock_artist 5y agoI wouldn't say outdated. Like C++ which is even older, it has iterations adding more modern capabilities like Java 8.
- nsonha 5y agoI like the simplicity of java, syntax is a bit lame but the majority of language is sane. I used to hate the fact that every file must be a class but if you respect inversion of control then that's a good default. The part that I think really stupid is java beans.
- dkarl 5y agoThis post from "an ignorant computer science undergrad" is pretty silly, so allow me to get a little silly in response. I think if Java's new features are an attempt to woo new developers, Java comes off pretty tragically, like the old guy in the club, trying stay relevant by showing off how it just got up to date with ideas that hit the mainstream ten years ago. Whoa, check out these record classes! Fresh stuff over here! I don't think there's any significant audience for this (a few "ignorant computer science undergrads" aside,) and I doubt that's what Oracle is shooting for. I think what Java is really doing is reassuring people who committed to it long ago that it will take care of them. Java is not the old guy in the club; it is the middle-aged guy dressing up and taking his wife out for a night (or half an hour, depending on her arthritis) of dancing at a jazz bar. It's doing its honorable best to show the people who committed their lives to it that it understands they still need a little bit of excitement now and then, and they don't have to sacrifice their dignity to some cad at the bar at the country club to get it. They don't really want to leave Java. Java understands things about them that nobody else ever will. All Java needs to do to keep them is love them enough to keep doing its best.
- ebiester 5y agoMore importantly, there are likely billions of lines of java code in production at this point, and just having that as an option matters for those code bases. It might not be what you choose for a new company, but it may not be fashionable here but it is very common and quality of life improvements are welcome.
- dkersten 5y ago> I doubt that's what Oracle is shooting for My guess is that they're not trying to win over people from other languages with these features, but rather to not give Java people a reason to move to other languages. Why move (legacy and lock-in aside), when Java has the features you're considering moving elsewhere to get?
- hyper_reality 5y agoThis is funny and I would love to hear your personifications of other languages. I imagine Python and Perl offer a lot of material.
- hcarvalhoalves 5y agoI don’t care much about the language, but the JVM/ecosystem might be underhyped, yes. There’s no GC’ed VM that competes with it still, compatibility is taken seriously and what build systems + Docker try to solve now with a lot of moving parts was solved years ago with uberjars.
- mr_tristan 5y agoJava really hasn't had great social stewardship for some time. Oracle has really just kept the tech going, but there's a number of very real issues: Newcomers get no real guidance on what to do. What do you install? It can be any of a number of different vendors. How do you deploy? The official documentation hasn't been updated since Java 8: https://docs.oracle.com/javase/tutorial/deployment/index.html https://docs.oracle.com/javase/tutorial/deployment/index.htm.... It still mentions applets! (Which are going to be removed soon.) IMO, all projects should be using jlink and shipping a slim runtime they've used to test against (https://docs.oracle.com/en/java/javase/11/tools/jlink.html https://docs.oracle.com/en/java/javase/11/tools/jlink.html). There's basically zero documentation on how to use this for non-modular applications, and you have to find and apply non-official plugins to get that work done. I continue to see most deployments using the entire JDK which, honestly, has been unnecessary for three years. Nobody really knows what they mean with "OpenJDK". They might be talking about some distribution based on the source code. Or, they might be talking about a download from jdk.java.net. Or they might be talking about installations from Azul, Microsoft, AWS, or any number of ad-hoc vendors because the name is unlicensed. This is a big deal, because I've had team matest install "OpenJDK" and actually end up with ad-hoc builds that weren't tested, and had random bugs. Professionally, I've ended up having to deal with fixing landmines because Java devs tend to not learn the intricacies of their frameworks as well. The technology is still going strong, and is moving faster since the modularization. Loom (https://blogs.oracle.com/javamagazine/going-inside-javas-project-loom-and-virtual-threads https://blogs.oracle.com/javamagazine/going-inside-javas-pro...) will be a big deal... but I wonder, will most devs practically understand how to take advantage of it?
- daptaq 5y ago> Java simply feels good to write. A lot of this is due to the craftsmanship JetBrains puts into IntelliJ IDEA The issue with Java is that you need an IDE for it to be usable. That's not an argument for Java itself.
- kaba0 5y agoIt needs an ide as much as any other language. Java programmers are just lucky that they have the best IDEs around.
- daptaq 5y agoGo was perfectly usable without an IDE, before gocode broke. And I'd still rather program C without any help than Java.
- kaba0 5y agoWell, C doesn’t have great IDEs because of its reliance on text-based macro magic. And that is your opinion, not shared by many. There is nothing inherent in the language that makes it hard to write from a text editor. It’s definitely not made for scripting, but with like 4 additional lines you have to write as a main method, I wouldn’t call it infeasible.
- ElectricMind 5y agoI am creature of habits. I like consistency in my world. I hate chaos. Java is not perfect language. But with Java I feel peaceful. At least I am not surprised by my own code. Underhyped or overhyped - I am with Java :)
- nickelcitymario 5y agoLost me at "This cannot be understated: Java simply feels good to write."
- andrepd 5y ago>Surprising absence from university curriculum Oh if only that was true. Sadly it's probably one of the most popular languages in undergrad courses around the world.
- pbadenski 5y agoFor me personally, it's really important how productive a language environment is after a few years of development. Therefore: - debugging environment - memory and CPU profilers - compilation and linting time of 100k+ codebases - IDE support for 100k+ codebases - static analysis & software architecture metric tooling (complexity, dependency analysis etc.) - inherent scalability of the language, maturity of patterns & practices of scalability
- 131012 5y agoI see a lot of comparison with Python and Rust and other languages, but not with C# which I feel is the true java equivalent. Anyone worked with both? I feel this is the comparison I'd really appreciate.
- dalleh 5y agoI have never done anything professional in Java but I used Maven and Gradle build systems enough to make me hate everything about Java. I don't know about the language itself but as an ecosystem Java failed spectacularly. Why is there a strong relationship between an application developed in Java and lack/horrible setup of documentation for this app? I just find it everytime I use something developed in Java.
- spacemanmatt 5y agoPerhaps Java isn't the most popular tool in the shed but its LTS story is unstoppable. I rank Java with Apple/Microsoft, in terms of respecting developers' investments in their APIs.
- ascagnel_ 5y agoI think it's interesting that you're lumping Apple in there. Their iOS stuff has been fairly stable, but they've been fairly aggressive in chopping off support for legacy tech (32-bit apps was a big one, especially in the macOS world).
- spacemanmatt 5y agoI have followed Apple architecture since the 128k Mac and the Lisa. They have studiously avoided breaking all apps at the same time. To wit, the 68k to Intel migration for many was recompiling with Xcode, and some code review per Apple guidelines. They actually went to great lengths to give you tools to ensure your migration went as smoothly as possible, where the OS interface was concerned. ARM: Lather, rinse, repeat, or not, if you are satisfied with emulated performance.
- deleted 5y ago[deleted]
- goldenkey 5y agoComparing TypeScript to Java is like comparing a swimming pool to a sauna. Yes, "ignorant CS undergrad" is quite apt. Java is one of the most unpleasurable technologies to work with. It is slow to start up, full of idiosyncrasies, and all in all, a pretty awful language when it comes to brevity. Java is the epitome of "lets use this language so we can hire cheap coders." It is a vestige of what it came from, even if some new features have been added 10 years too late.
- exdsq 5y agoI wonder if it’s ‘fun to write’ because the boilerplate lets the author feel like they’re writing lots of code, even though it’s unnecessary in other languages. I’ve never met a developer in industry who prefers Java to Scala, and having used both in production myself, I’d agree too.
- P_I_Staker 5y agoSo, I'll admit to not reading TA, but I find this headline a bit silly. Isn't java one of the most widely adopted languages, maybe THE most used? Top tier at least. People aren't using it for no reason, same with C.
- hnal943 5y agoIs this a joke?
- isamuel 5y agoAs a bookmark I can point to later, I want this on record: This kid's going to the moon.
- victornomad 5y agoI used to dislike Java until I had to refactor code with Javascript...
- RivieraKid 5y agoJava is a good language for many use cases. What are the alternatives when I'm looking for a language that is at least as fast, statically-typed, garbage-collected, multi-platform, has good IDE support and similar amount of libraries? There are not many. There's Kotlin (better than Java but not by a big margin), Typescript, anything else?
- The_rationalist 5y agoKotlin is better by a large margin.
- vikingcaffiene 5y agoThere is no greater sin than to say something positive about Java on the orange site... IMO Java and C# and other compiled languages have the opposite problem with languages like python and JavaScript (I love all these languages btw). It’s easy to get up and running quickly with the latter. It’s not until your project has grown in complexity when the formers value becomes apparent. This is similar to mongodb vs say, Postgres. Also modern Java has picked up a lot of the better ideas from Kotlin and Scala. I still prefer Kotlin but I think a lot of criticism I read is referring to older versions of Java.
- packetlost 5y agoAs someone currently trying to juggle a massive, extremely complex Python project, our code looks very Java-esque just so we can actually understand what's going on. Java/C# absolutely have a place, but the heavy startup mentality here will always lean towards "whatever lets me pump out my crapware and go to market fastest". Startups aren't known for producing well maintainable code (not that you can't make maintainable code with JS/Python, it just gets much harder at higher complexity scales).
- vikingcaffiene 5y agoAgree. It’s YAGNI until you YNI. ;p
- slt2021 5y agothere are couple real reasons why managers/executives should choose Java over the other language: 1. it is battle tested, stable, and its strong and weak sides have been pretty much studies and internalized by developers 2. Java devs are like sand on the beach. They can be found everywhere at a cheap price. Develop something, then slowly outsource/offshore dev to cut costs and continue milking sales contracts.
- batushka3 5y agoJava development is like eating fish with bones and caughing to get them loose ocasionally. My stomach hurts when I think Python jobs may run dry and I'll need to go back to Java.
- freedomben 5y agoI've never heard someone with experience in npm say they love maven. Interesting. Regardless, I actually agree Java is a fine language. I'm still surprisingly productive in it despite 10 years of time away. However, it's the culture around Java that I hate, and that's the reason I avoid Java. The amount of low quality Java code out there is staggering. The culture around Java is one of extreme levels of abstraction and encapsulation, and it makes reasoning about Java code really painful some times. If you have worked in a Java shop, check out the Enterprise edition of FizzBuzz: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- kaba0 5y agoThere are as many Java developers as people in a smaller country. FizzBuzzEnterprise is just a big subset of them, but there are so so many other interesting niches, like robotics, hell real time usage, everything.
- desktopninja 5y agoPersonally for me: java -jar application.war Is as elegant as: v=ir
- nesarkvechnep 5y agoI think the author just hasn't seen enough. There's not a single language that's better than every other language at everything. Java's type system is inferior to ML language's type system. Java's developer experience is laughable compared to Common Lisp's interactive development. A lot of languages have great package managers - Rust and Elixir comes to mind. Also sometimes smaller community with higher quality is better than huge community with average or below average quality. It always depends. I hope the author doesn't turn into a Java monoglot just because other languages are different. Well, problems also differ from one another.
- jaywalk 5y agoThe fact that somebody had to point out to him that C# also met his four points under "A holy grail of productivity" should tell you all you need to know about his complete lack of experience in the field. This is nothing more than the ramblings of an inexperienced kid who thinks they know it all. He'll probably look back on this in a few years and realize how little he actually knew.
- Gnarl 5y agoNorwegian is underhyped; performs way better than Swedish. Stop quibbering over programming languages already and just build well-tested, robust software.
- hahamrfunnyguy 5y agoAs a now old guy developer, I laughed when Microsoft released C#. I figured it was just a half-assed attempt at a Java clone. Then I used it, and realized I was wrong. Microsoft has been continuously improving the language, and .NET has support on a lot of platforms. As long as Microsoft keeps making my life easier, I am going to keep using it. I haven't worked on a big Java project in a few years, but I would always find myself missing stuff from C#.
- zkmon 5y agoI completely agree with the author. When writing Java code, you get a sense of standing on a bed rock that never lets you down. You can be assured that you get everything you need. It is like a childhood friend or relative who always stands besides you and supports you. I don't get that sense when using any other languages though I have been using them for same number of years. The other languages sometimes annoy me by misguiding me or by being poor in some aspects, but never such case with Java. I have total respect to this language and I go to it whenever these more hyped languages give me a chance to do so.
- deleted 5y ago[deleted]
- gpapilion 5y agoI was surprised that java was missing from CS curriculums at University of Colorado Boulder. Roughly 20ish years ago we moved the data structures class to java at the university I worked at. There were a lot of complications(students hadn't learned java previously), and it took some understanding of what the JVM was doing, vs c/c++ where pointers made it very clear what was happening. This was also in very early days of java, just at the beginning of JIT and hotspot.
- eyelidlessness 5y agoI think the discussion about TypeScript, and particularly type guards, really misses the point. Structural typing and manual type narrowing is basically what you’d do anywhere you don’t know some data’s type in the first place—for instance when you get some JSON from an external service. It just happens that that’s fairly common in JS/TS. It’s also a natural consequence of TS explicitly choosing not to expose its type system to the runtime; a choice which confuses many, but makes sense given the potentially unpredictable performance impact that could have. But there are plenty of good tools for declaring validation and getting types “for free”, allowing you to choose explicitly where you want to incur that runtime cost—typically at API/network boundaries. This is not much different from interface/protocol/contract based typing, which often appears in a goofy way in Java: class Foo implements IFoo. But when you work in an environment where interface typing is commonplace and done well, it really helps guide good modular design.
- otterley 5y agoI really like the fact that you have to declare when a class implements an interface. I consider it a valuable feature in Java. It’s a tremendous boon for documentation because it makes finding compatible classes much easier. Documentation indexers make this a snap, and it makes it easy for IDEs to autocomplete for you. I have spent more time than I ought to have trying to find conforming types in TypeScript and Go code through trial and error. Fortunately I get feedback pretty quickly in my editor, but it is still a frustrating exercise. I want to build mechanisms, not solve jigsaw puzzles.
- eyelidlessness 5y ago> I really like the fact that you have to declare when a class implements an interface. I consider it a valuable feature in Java. It’s a tremendous boon for documentation because it makes finding compatible classes much easier. Documentation indexers make this a snap, and it makes it easy for IDEs to autocomplete for you. In some contexts I miss this in TS, in others I find it unnecessarily limiting. Probably an even split. Though I find myself wanting nominal types more for primitives (sure email is a string, but not every string is; or is this number really an unsigned int?).
- throwaway189262 5y agoJava is rock stable and "complete". Not just the language itself. Build tools, JVM, profiling, dependency management. Everything is at least decent, most language problems were solved years ago. I have used many languages and nothing comes close to Java in the balance of speed, flexibility, ecosystem, and polish. If you're not sure which language will be best for a project, Java is perfect. I work on a codebase with hundreds of thousands of lines that haven't been touched in 15 years. We're on Java 11 with plans to update to 17 later this year. Our 8->11 upgrade took me 3 days on a million+ line codebase. And when we released there were zero bugs related to the upgrade. Java has the stability keep projects maintainable over decades. The only mainstream language with comparable backwards compatibility is C.
- metaltyphoon 5y agoC# ?
- throwaway189262 5y agoThe languages are kin, but Java has more going for it. C# is much smaller community. Microsoft isn't as good about avoiding breaking changes. Java has more quality tooling options. The CLR GC is way worse. Shenandoah and ZGC, and even G1 on new versions blow away CLR GC. Also heard the JIT compiler isn't as good from an Oracle dev a while back. C# performs better in synthetic benchmarks because it exposes more low level primitives. C# is far ahead in syntactical niceness and exposing lower level primitives. It also has reified generics and true primitive types. The "language" itself is definitely better than Java, there's no question. It's everything built around Java and the capabilities of the JVM that make it better than C#.
- kodeninja 5y agoSorry, but _nobody_ Maven.
- hankchinaski 5y agocan you actually write/compile/run/debug a "modern" java project without using a bloated IDE and waste half your morning tinkering with XML configs? my current setup with Go is amazing, I can use a minimal vim/tmux setup to work on just almost anything and it's great. my experience contributing to big java projects has been enough to make me dislike it and never look at it again
- cutler 5y agoHow Java 16, 17 or whatever can claim to be catching up to anything, let alone Kotlin, whilst it still requires developers to escape regex metacharacters - even after introducing raw strings - is beyond me.
- lee 5y agoJava is the mini-van of programming languages. It's not fast, not specialized, but is completely adequate for almost all use cases. A mini-van is incredibly boring, but that's also it's best selling point.
- davecheney 5y agoThe author is correct, I _am_ wondering what they are smoking.
- maxandersen 5y agoFor All those who feel Ibstall of java, using maven/gradle and all the Other ceremony about java is too much give a try to https://jbang.dev https://jbang.dev. Setup jbang and install java if needed: curl -Ls https://sh.jbang.dev https://sh.jbang.dev | bash -s - app setup jbang Create a java file that has dependency on picocli and just runs: jbang init -t cli hello.java Run it: ./hello.java Edit it in vscodium with live fetching of dependencies(you can use your own ide too): jbang edit --open --live hello.java
- intellix 5y agoI have an opinion but it's compiling. Check back in 10 minutes to read it.
- RyanPringnitz 5y agoAfter learning SQL, Powershell, VB script, and taking a fifteen week CIS course on Android; Java was a natural segway for me. I work an an Android use case, so reading Java stacktraces, and code commits became a valuable skill. Then, I learned the value of using Java libraries such as Appium and Selenium for end-to-end integration, performance, and reliability testing. Then I started using Java libraries like Okhttp, Jackson to build fancier test setups. While this was happening, I was learning the value of writing code that could be ran in containers - which Java does. Now I can create microservices that I stick in containers on Google Cloud Run or Pivotal Cloud Foundry - and pass arguments to execute tasks. After getting these foundational skills developed, I started working on adding features to Android apps in the use case. Since I had learned that much, I figured I should write a personal site using Spring MVC, Spring JPA, VueJS, ChartJS, and CockroachCloud (postgres). I then went and wrote a DAO microservice to write to CockroachCloud on a recurring schedule, and used Java with JDBC to learn how to access postgres without Spring. Java has become a great skill, that I picked up almost entirely during the pandemic. Especially when paired with Javascript. On Javascript, what I find interesting is that some teams have rewrote services from Javascript to Java. IME, Java works on everything, and with everything. Once you master one object oriented language, having to learn Objective-C or another variant of Java like Kotlin or Scala becomes that much easier. IMO, there are 3 things are worth learning. They are SQL, a high level scripting language, and a object oriented language. They all have their uses, and the skills are transferable. For me, Java just happened to be the most valuable skill I could learn.
- danielscarvalho 5y agoUau! You are a hater! Are you vegetarian too?
- drallison 5y agoThe Java language is proprietary to Oracle. Oracle lost their lawsuit with Google with the SCOTUS finding that Google's use of some declarative code was "fair use". Oracle's license requirements and its litigious history is enough for me to not want to use Java in a product setting. I personally find the Java language cumbersome and the type system constraining. These days my preferred languages are Python, Go, and C. In my experience, Java is not a good choice for exploratory programming where adapting old code to new use takes significant repurposing effort.
- jzoch 5y agoI write java all the time and have the following things I never want to deal with again: - Maven - Gradle - Weak type systems - 1 class per file and other dogma that leads to a million tiny pieces of spaghetti (cough GoF) - java version hell - garbage collection tuning (yes at scale its necessary and no I don't want to make more grafana dashboards of our application's gc and whatever open-source datastore we are using's gc since they thought it was smart to write in java) - verbosity to the max - people convinced none of the points are problems and that they are actually features. Its one thing to deny my pain it is another thing entirely to say its a "good" pain.
- SZJX 5y agoThe author doesn't seem to be that experienced yet and the arguments/comparisons don't seem so strong IMO. If they say they were hyped about something like Elixir/Haskell but now they are all in for Java, then OK, there might be a quite interesting story to tell. But coming from TypeScript as a backend language to Java as a backend language?... Come on. This is as much of a no-brainer as it can get. It by no means implies Java is any good compared to many other options out there, but is more a testament of how much of a way the JS ecosystem still has to go. I totally agree that Java is not bad (also chatted with some friends about IntelliJ etc.), but as many have pointed out, it simply has a lot of weird tradeoffs that are already baked into the language. I always say that maybe in a few years I'd just say screw it and go write Java for a big corp. But for now I'd still like to enjoy writing Elixir with similar-minded folks as much as I can. Nothing compares to it in terms of developer experience yet. Maybe it's a form of meaningless stubbornness/resistance idk.