14 ms·
Why I Like Java (2014)
- lasereyes136 5y agoI have written a good deal of Java as a professional Java developer for over 10 years. The core truth the article gets right is that Java is meant to be a language Enterprise developers can use and be reasonably sure other people can pick it up and work with it. Java is a defensible choice in that you can hire people that know Java, easily buy Java training, and have a lot of tools for Enterprise Java development that you can get (OSS or commercial) that will help your Java developers get Enterprise apps created. Java, in many respects, is the COBOL replacement created in the 90s that will live on in the Enterprise for decades to come. Just as COBOL lives on.
- jordanpg 5y ago> write a program that copies standard input to standard output This is pretty trivial in Java, just as in other languages. But most people don't ever need to learn the low level `System` methods needed to do it. To me, this highlights the difference between a comprehensive approach to learning a language and a more piecemeal one. I learned Java by reading the canonical books from cover to cover, like Effective Java. But I think this is pretty rare. For example, I recall interviewing many experienced Java programmers who didn't know what things like `protected` or `volatile` mean.
- marktangotango 5y agoVolatile is an interesting one because it highlights a facility of the JVM that some other runtimes don't provide, namely multi-threading AND multi-process. Someone coming from node or python for example may not appreciate what's going on behind the scenes unless they go looking or have been exposed to those ideas.
- MrBuddyCasino 5y agoMaybe thats the difference between "having mastered something" and "doing something a long time"? I cannot imagine an experienced Java programmer that doesn't know what "protected" means, its use is fundamental and pervasive. As for "volatile", idk - not knowing it hints at that person not having a concept of thread-safety. I'd expect someone who claims to be a senior to maybe not give me the memory model implications, but at least having a rough idea of what it is used for.
- pie_flavor 5y agoVolatile is specifically C's thread safety. AtomicInteger and ReentrantLock (aka mutex) are what a thread safe person should know.
- zozbot234 5y agovolatile has nothing to do with thread safety or the memory model in modern C. It's strictly for access to memory-mapped resources, where common assumptions relied-on by optimizers may fail. It should never be used for multithreading, use proper atomics and other provided facilities instead.
- nicoburns 5y agoCorrect, but it’s worth noting that ‘volatile’ in Java does provide atomicity.
- zozbot234 5y agoTrue, the guarantee of atomicity does come up in Java wrt. fields of type long or double, for which atomicity is not provided by the Java memory model in the absence of volatile. More to the point, volatile in Java provides linearizability which is a bit stronger than simple atomicity.
- ysleepy 5y ago*sequential consistency, not linerarizability
- aardvark179 5y agoWhile somebody writing concurrent Java code should definitely know the atomic classes, locks, and possibly var handles if they are implementing their own algorithms, they absolutely should also know the semantics of volatile. It does not provide thread safety in C or Java, but it’s very important in choosing how to define your data structures.
- _0w8t 5y agoIt is rather non-trivial to write a program to copy input to output if one requires proper handling of a termination signal when the code flushes the already read data without waiting for more and exits without loosing any buffered data. Knowing how to do that is a good sign that the person really knows the language and it’s libraries.
- throwaway2037 5y agoCan this be done with vanilla Java? If yes, can you share a snip of code? I would curious to learn! Using POSIX C, I think I know the solution.
- xmodem 5y agoYou need to register an event handler with `Runtime.getRuntime().addShutdownHook()`.
- _0w8t 5y agoAs another comment has written one needs Runtime.getRuntime().addShutdownHook(). The hook then, for example, closes the input stream to ensure that it’s reader is woken up from a blocking read and then waits until the already read data is written. In turn this requires to know how synchronization works.
- Scarbutt 5y agoWouldn't just wrapping System.in with the Scanner class handle this?
- StevePerkins 5y ago"protected" should be obvious, if you've worked on any non-trivial Java codebase. However, I've been working with Java for over 20 years now, and don't think I have ever actually used "volatile" once. The only reason I know anything about it is because I read "Java Concurrency in Practice" once upon a time, and have a really good memory. In my experience with concurrent code in the business world, it's more common to enforce immutability rather than try to manage state updates. On the RARE occasions to the contrary (e.g. a "tripwire" flag of some kind?), accuracy is more important that maximum performance, so you would use an atomic class or something synchronized. Really, I think this example more than anything else just shows that technical interviewing is a speed-dating crapshoot. You just have to interview at enough places to find an opportunity you're excited about, and where you happened to not stumble across any interviewer's personal bugaboos that don't match up with you.
- throwaway2037 5y agoIn my career, I have used volatile incorrectly many more times than I have used it correctly. :) For readers who are not deeply familiar with Java's volatile keyword, you can read more about it here: https://stackoverflow.com/questions/13688697/is-a-write-to-a-volatile-a-memory-barrier-in-java https://stackoverflow.com/questions/13688697/is-a-write-to-a... I feel the same about robust, easy to maintain enterprise software: Just use a blocking queue (or disrupter circular buffer for speed freaks) and make all messages/requests immutable. It is a trivial concept to explain to new hires and all but guarantees "boring" thread-safe code can be written by junior devs. I think I finally understood volatile (in a pratical setting) when I read the source code for class CopyOnWriteArrayList. To be honest, the first few times I read it... the pattern made no sense. I thought to myself: "Why use volatile?" After reading many times (and using volatile wrong many times), I finally understood the pattern.
- throwaway2037 5y agoYour comment made me think of a very difficult programming interview question: Can you copy STDIN to STDOUT in a non-blocking fashion? My point: The most trivial solutions assume that STDIN will give you all the data very quickly, then STDOUT will accept 100% "instantly". Using only Java, I don't know the solution off the top of my head. I will need to do a little bit of research. However, using POSIX calls with C (select() and friends), yes, I could imagine a way to do it. Deeper: Can you write a function to launch an external process then (a) write to its STDIN, (b) read from its STDOUT, (c) read from its STDERR -- all independently and without blocking? It's a hard problem!
- commandlinefan 5y agoI learned Java from the “Core Java” books 20 years ago. The language has changed so much since that I’m tempted to pick up another “Java from scratch” series and read it cover to cover to see how new developers are viewing the language now.
- ysleepy 5y agoYeah, keep writing perl and spout cynicism about everything. I feel like they are chasing a aesthetic of conciseness, their perfect little haskell program, not recognizing that regularity and good api design are much more important. What is beautiful for a 100loc program becomes ugly and wrong for a 100kloc program. Other aspects become much more important. I'm not a huge fan of go, but it proved there is a necessity for boringness in cooperation. Boring syntax does not mean the upper limit is mediocrity, saying that is revealing shallowness.
- zozbot234 5y agoThe notion that languages focused on writing large-scale programs must be "boring" seems a bit silly. What these languages need is lots of ways to define sensible modularity boundaries, and the "boring" aesthetic (or lack thereof, rather) can really get in the way of that.
- pjmlp 5y agoThe point being that at scale all code should be written the same way, in an environment where most teams are composed of rotating consultants.
- marcosdumay 5y agoWell, the counterpoint is that you shouldn't have a team composed of rotating consultants. And if you have one, you can't expect it to deliver anything with any quality or productivity. But yes, if that's your team, then all code should be written the same way, all on the most boring way possible. There's a reason Java and C# are so popular.
- pjmlp 5y agoThis is the modus operanti from all Fortune 500 whose main business isn't shipping software, for them IT is a cost center.
- unnouinceput 5y agoYeah, reading it all I still think the author is just dissing Java, despite his, in big bold font "I really like Java". Nevertheless I had a really good laugh.
- mi_lk 5y agotangent: what are some modern java OSS codebases that you would recommend to read?
- smrtinsert 5y agoWhat do you want to do?
- mi_lk 5y agoWant to pick up some modern Java(11+?) best practices in general since my knowledge is mostly stuck in Java 7/8. Would appreciate recs on codebases, books, talks, etc.
- RhodesianHunter 5y agoCaffeine caching Google's Guava JCTools
- throwaway2037 5y agoNothing taught me as much about API design and testing as Google's Guava. I know there are lots of minor gripes with that library, but is it so incredibly consistent. It is also amazing that no one mentioned the Java Collections (ArrayList, LinkedList, HashSet, HashMap, TreeSet, TreeMap). They are some of the highest quality generic collections that exist anywhere. (For C++, I would say the same about an STL implementation by a high quality project like VCC/GCC/Clang.) For "Java high honors", try to understand how concurrent collections work, e.g., ConcurrentHashMap! For highly specialised containers, try: (1) https://labs.carrotsearch.com/hppc.html https://labs.carrotsearch.com/hppc.html, (2) https://github.com/OpenHFT/Chronicle-Queue https://github.com/OpenHFT/Chronicle-Queue, and (3) https://github.com/LMAX-Exchange/disruptor https://github.com/LMAX-Exchange/disruptor
- jpgvm 5y agoI like the Apache Pulsar codebase. Well designed with a mix of code at different layers of abstractions depending on the module. Particularly good if you want to learn about writing network servers and distributed systems.
- oweiler 5y agoThis hasn't aged well https://docs.oracle.com/javase/9/docs/api/java/io/InputStream.html#transferTo-java.io.OutputStream- https://docs.oracle.com/javase/9/docs/api/java/io/InputStrea...
- commandlinefan 5y ago> since Java 9 Sure took them long enough.
- smoyer 5y agoYou can write a pretty trivial Java program to copy stdin to stdout but Java is still one of the enterprise languages and people writing enterprise applications don't tend to write this type of software (but they do tend to have log4j vulnerabilities). The strengths of Java are its mature dependency management system(s), its comprehensive standard library and the vast ecosystem of third-party libraries. A better test of the language is whether you can write a complicated application in relatively fewer lines of code. I spent much of my career writing Java code but have moved to Go - it's almost a return to my roots as an embedded systems engineer (without the memory management hassles of C) and it's vastly more economical to run Go applications in containers. I do find myself writing code that I used to pull in from a library though.
- kingkongjaffa 5y agoPeople say this but where do you find libs for Java? Python has pip, JS/Node has NPM
- tlarkworthy 5y agoMaven central
- coldtea 5y ago>People say this but where do you find libs for Java? Everywhere, on the lib website, on GitHub, on Apache, etc. (including centralized places like Maven Central). You then put a ferences in your Maven or Gradle file like you would in your package.json. In fact, because for 99% of the libraries you just need to have a jar (or more) in your classpath, you don't have to have all the ceremony that Python has, and all the installation mess, venvs, and other such shite.
- Macha 5y agoUntil you end up with dependencies transitively pulling in conflicting versions of Jackson or similar and you need to mess around with dependencyManagement or exclusions.
- coldtea 5y agoIf the infamous HN Dropbox comment didn't exist, this post would serve well as the canonical "facile dismissal". Reminded me of PG's essay about the "blub" programming language. But, in this case, I'd like to reverse the use of the concept: it's not that Java is a blub programming language, but that the OP has only reached a blub-state of understanding it and its potential, and produced a blub (generic and derivative) argument against it.
- the_af 5y agoI don't think Mark Dominus has a "blub level understanding". This is the author of the hilarious "monads are like burritos" and many others, and it's quite clear that he is very opinionated but also very knowledgeable about programming languages. Having programmed in Java for... what, 15+ years? I do agree with him about his assessment. Trying to solve an interview challenge in Java is to handicap yourself, unless it's the only language you know.
- coldtea 5y agoYeah, I'm not really talking about the OP per se, to be frank (didn't check who he was, and I don't know his story). So, my assessement wasn't about the OP in general, but the OP as revealed by this particular post. The post is based on the cliche early/mid-00s J2EE style of coding, that hasn't been in fashion for 15 years, and has been derided widely for at least 12. There are amazing apps and libs written in Java, and Java as a language was not a problem for their development and design (even when it was far more restricting and ceremonious). Lucene for one. Vert.x. Jetty. XOM, ...
- throwaway2037 5y agoIf people are unfamiliar with the "blub" programming language, you can read more here: https://wiki.c2.com/?BlubParadox https://wiki.c2.com/?BlubParadox Here is Paul Graham's original essay: http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html To quote Wiki (https://en.wikipedia.org/wiki/Paul_Graham_(programmer) https://en.wikipedia.org/wiki/Paul_Graham_(programmer)): << Graham considers a hypothetical Blub programmer. When the programmer looks down the "power continuum", they consider the lower languages to be less powerful because they miss some feature that a Blub programmer is used to. But when they look up, they fail to realise that they are looking up: they merely see "weird languages" with unnecessary features and assumes they are equivalent in power, but with "other hairy stuff thrown in as well". When Graham considers the point of view of a programmer using a language higher than Blub, he describes that programmer as looking down on Blub and noting its "missing" features from the point of view of the higher language. >> In my experience, it sounds like a very cool idea, until the first time you see someone programming DirectX using Excel/VBA. (Yes, it can be done.) My point: When you see someone using a "dumb" language (in your humble view), first ask if you are ignoring a Chesterson's Fence! For the avoidance of doubt, no, I am not seriously suggesting it is a good idea to program DirectX using Excel/VBA in 2022.
- CraneWorm 5y ago> Different languages have different failure modes. With Perl, the project might fail because you designed and implemented a pile of shit, but there is a clever workaround for any problem, so you might be able to keep it going long enough to hand it off to someone else, and then when it fails it will be their fault, not yours. With Haskell someone probably should have been fired in the first month for choosing to do it in Haskell. So much unnecessary hate and stereotyping. And I bet they were thinking they're tongue-in-cheek-but-still-sounding-clever. Also, interesting choice of programming languages, neither Python, PHP nor C got any flack, Javascript was spared but Java, Perl and Haskell are evil and using them makes you a "mediocre drone that cares only about cranking the lever and spouting code" (I'm paraphrasing the article here). Choose your technology, learn your tools... > I enjoyed programming in Java, and being relieved of the responsibility for producing a quality product. Although, with that mindset, maybe forego programming altogether.
- the_af 5y agoThe author makes it really hard to judge his tone, but I don't think you're reading it right. For example, if you peruse his other articles, it's clear he really likes Haskell (he certainly doesn't consider it evil). I can't say I understand every one of his assertions, and trying to be funny/sarcastic makes it hard to truly understand the point of his article, which I think is: Java lacks focus and is a verbose language, and therefore you should probably pick something else to solve interview challenges. I tend to agree.
- tomxor 5y agoI thought he summed up the tone pretty well earlier in the article: > Java is neither a good nor a bad language. It is a mediocre language, and there is no struggle. To be more explicit - I think the point he is trying to make is that Java is not very powerful (in sense of expression), which has benefits (making it hard to fuck up badly) but at the cost of pushing the programmer towards mediocre, verbose and inefficient solutions (again due to lack of expressiveness, trying to come up with elegant and efficient solutions is too tiresome). Perhaps it's the difference between a scalpel and a blunt club. You're not going to cut off your own fingers with the club, but you're not going to be able to perform brain surgery or fix someone's heart either. Not the best analogy because technically Java and any other language is turing complete, but they are not equal in how easy it is to coerce the machine into performing a particular computation, and expressing that humanly.
- Semaphor 5y ago426 comments when it was originally posted in 2014: https://news.ycombinator.com/item?id=7463671 https://news.ycombinator.com/item?id=7463671
- da39a3ee 5y agoI’ve recently joined a company using Java. I’m open minded, and know that there are lots of good things about the JVM and the modern Java language. However one thing I hate is the complete disregard for command line UX. People writing Java command line tools seem to think it’s absolutely fine to spew 1000 lines of unformatted informational messages and non actionable warnings with bizarre indentation and not to provide any flag to turn this shit off. It’s like they just view the terminal as some sort of obscure log file that no-one’s likely to look at.
- nicoburns 5y ago> It’s like they just view the terminal as some sort of obscure log file that no-one’s likely to look at. From what I’ve seen of Java developers it’s more likely that they see it as an IDE pane that has filtering capabilities built in.
- ysleepy 5y agoJava programs are usually daemons and internally use a logging library, per default stdout is set up as one output for logging. One can usually configure the logging with the log4j or logback config files and even suppress stdout.
- notriskfree 5y agoEspecially annoying when reams of nonsense also gets 'unexpectedly' sprayed into the web browser of some poor sod using an enterprise app, just because Java is having a bad day. This seems to happen less than it used to a few years ago, so there is some progress going in in software engineering, somewhere.
- the_gipsy 5y agoNobody wants to be blamed for something not being in the logs, probably in production. So everybody adds everything to the logs, you can always filter out the noise but not the reverse, right? And very soon the logs are completely unusable for your regular-dev cycle. Of course in java world, the IDE reigns, and checking logs is an "antipattern" anyways, you must use the fantastic debugging GUI that is provided by the behemoth. Everything is normal, you see.
- FpUser 5y agoI've had a bit of fun with Java some years ago when I was asked to write a converter from some proprietary music format to midi. Using Java was non negotiable requirement. While I succeeded and the project brought me gobbles of cash in very short time I was grinding my teeth on byte / bit level manipulations. Java was definitely not created with this kind of programming in mind.
- jnmandal 5y agoFive years ago I might have said this was a "dis" or "flame" article. Now I too see the benefits of java while simultaneously feeling it's a bloated and verbose language. We have a tendency to believe that everything we produce needs to be "high quality" but that is a subjective measure. Sometimes we just need to write a program that can be handed off and maintained by the next set of devlopers. For that, java is a useful tool. Programming languages are just tools. You will have your favorite to use but that doesn't mean it's the one you should be using on most jobs.
- jhbadger 5y agoExactly. It's not unlike the famous "worse is better" argument about how UNIX and C triumphed over Lisp Machines despite being "worse". https://en.wikipedia.org/wiki/Worse_is_better https://en.wikipedia.org/wiki/Worse_is_better
- exabrial 5y agoThese sort of posts crack me up as it's another person jumping on a bandwagon they don't understand, but are also really sad, as it's taking a lot of otherwise talented people and ruining them. > being relieved of the responsibility for producing a quality product I've seen this sort of elitism in candidates and I've made the mistake of hiring them. It turns out they're just not very good at all, and they blame their failures on anything but themselves, stunting their self-growth professionally and interpersonally.
- tasha0663 5y ago> I've seen this sort of elitism in candidates and I've made the mistake of hiring them. It turns out they're just not very good at all, and they blame their failures on anything but themselves, stunting their self-growth professionally and interpersonally. If this is a trend for you, you're probably a bad hirer and in a toxic environment!
- bigpeopleareold 5y agoI'm not a professional Java developer, but I work at a company that uses Java, so it just came with the territory to understand things about it, even though I've already had at least a basic grasp of it. I feel blessed that most of the code is mostly straightforward Core Java code (as opposed to any framework-level fun). It is treated a bit like a systems programming language. However, I can agree with this article. It's safely boring to me (despite the fact that having an IDE to write your boilerplate is still necessary for the sake of your fingers.) Since not being a pro at it and not planning to be, I'd rather toy with other things. The job market is diverse in its technical needs. :)
- marktangotango 5y agoJava: plentiful well paying jobs, good/great tools, good/great runtime. Personally, I like boring, predictable, "easy" (referring to low cognitive overhead of statically typed languages in general) for work, and save the fun stuff (lisp/scheme in my case) for personal projects.
- jermaustin1 5y agoThis is how I feel about C# and .Net - they are relatively easy to hold in your head, the tools are excellent for the language, and there are plenty of decent paying jobs.
- tonyedgecombe 5y agoThere is very little to trip you up in C#, for my first project in it I sat down and started churning out code and looking stuff up when I got stuck. Try doing that with C++ and you will end up with a hole lot of trouble.
- dlandis 5y agoAlso, it bears mentioning that there has been a lot of momentum around new language feature in the past 5 or so years. Good overview here: https://advancedweb.hu/new-language-features-since-java-8-to-17/ https://advancedweb.hu/new-language-features-since-java-8-to... And many other changes in the pipeline too..
- commandlinefan 5y agoIf I have to maintain/modify _somebody elses_ code - dear god, please let it be java.
- The_rationalist 5y ago
- oftenwrong 5y agoJava has a high bar for the amount of prerequisite experience it takes to write good code. In other words, it has too many pitfalls for beginners. It is a phenomenally poor choice of language for teaching beginners to code. On the other hand, a lack of beginner-friendliness could also be seen as a lack of effective static analysis. Of course, this is a very Java programmer point-of-view. Others: "you shouldn't need to have that" Java programmers: "but I do have that" If you are in a position to pick tools for your organisation, think about how your choices would accommodate beginners. Not all of your tools can be or should be easy for beginners to use, but it is an important quality to consider.
- tasha0663 5y agoI'm curious what these pitfalls are that you're referring to. Can you elaborate? It's been a long time since I was new to Java, and this sort of outside perspective is always a good thing.
- chakkepolja 5y agoMaybe GP is talking about type erasure, or considering the mention of teaching, it might be something more obvious like reference type vs value type distinction, strings cannot be compared using ==, etc..
- 62951413 5y agoJava ain't no Scala to have any unusual prerequisites. It was designed as the golang of the day and that still shows in its lack of particularly sophisticated features. Speaking of beginners, I'd venture to say that Java has the largest library by now. From Core Java to Java Concurrency in Practice, pretty much everything was well described years ago. The same is true about Design Patterns/Refactoring/DDD-related literature which was originally popularized mostly in the Java world. I actually agree that JVM-like platforms should not be used for teaching beginners. Something like Python (or TypeScript?) is probably appropriate for high school usage. In my time it was Borland Pascal which was a nice first real language and a great IDE. All on a single floppy disk :))) I
- 5y ago
- yoyar 5y agoAnytime I learn a new language (I regularly write code in several) I start asking how is testing done, where are the libraries, where is this, and how do I do that? I already have all of that and more at my fingertips. Also, Groovy is vastly underrated. It’s the most economical and easiest to understand language I know meaning I can do more with less code and faster in general.
- zmmmmm 5y agoGroovy is definitely underrated when it's done properly (pretty much my favorite language when used as a "java substitute"). Unfortunately most people's exposure to it is in Jenkins or Gradle where it's a bit of a train wreck.
- yoyar 5y agoThat’s too bad. That helps me understand why it isn’t favoured as much as I would think/like.
- whoomp12342 5y agoJava was great, until oracle.... yeah.
- zcw100 5y agoI feel like people get what makes for the best programming language wrong in the same way they get the "fittest" wrong with darwinian selection of "survival of the fittest". It's not necessarily the prettiest (although that can help) or the fastest, or some subjective assessment of the best. It's what survives. Sometimes that's a stallion, other times it's a dung beetle but both are the best at what they do and if you put it in the wrong environment they die. Java's just doing what it does and it has survived where others have died.
- jcadam 5y agoI've found Kotlin to be a fantastic Java substitute. Fully compatible with Spring and seamless interop with Java. Though I prefer Clojure where that's possible.
- 62951413 5y agoKotlin is surprisingly good if you cannot afford Scala. It's less divergent from the Java ecosystem and doesn't introduce anything conceptually new. But it's not that popular on the backend. The only thing about it I personally find very unpleasant is its idiomatic approach to concurrency. In the world of Futures and go routines continuations are such an outlier. I find it hard to remember more than one company I have interviewed with in the last ten years using Clojure. It was hyped together with Erlang in 2009 or so and nobody remembers either.
- jcadam 5y agoI'm actually working in a Clojure job at the moment, but they're definitely hard to find. Scala is far more common.
- kebsup 5y agoI feel like my Java skills improved greatly after switching to kotlin, because it made me realize how much more code I'd have to write for the code to be nice. The simplest example would be "val x = ..." vs "final String x = ...". Sometimes I just wouldn't bother with the "final" keyword, but now I cannot let mutability ruin my code.
- ModernMech 5y ago> If it takes ten times as much code as it would to program in Haskell, that is all right, because the IDE will generate half of it for you, and you are still being paid to write the other half. Well that explains it. For me, I’m not going to touch Java unless I’m being paid to do it. IMO it’s a travesty that Java is the language of the AP test, because it really leaves the impression in young people that all of programming is Java. If that were the case, I’d be as far away from programming and computers as I could get.
- stickfigure 5y agoObviously the right solution here is: #!/bin/bash cat - Java has come a long ways since 2014. You can now code in functional style pretty naturally, checked exceptions are fading from use, and tools like lombok have stripped away the worst boilerplate excesses (getters, equals/hashcode impl). This always riles people up, but I'll assert it again: An equivalent modern app that does something useful is shorter in Java than in Ruby or Python, largely because the type system enforces many of the things you would otherwise have to write explicit tests for.
- vikingcaffiene 5y agoModern Java is actually pretty good. It's taken great features from other JVM languages like Kotlin and Scala and is much better for it. The JVM is a wicked fast run time and its nice to have a mature ecosystem of libraries to work from and large pool of developers available who know it inside and out. You could do far worse when picking a language for your team to use.
- nanreh 5y agoThis guy is like the character in Superbad that can only ever draw dicks but in his case every time he tries to write he writes “I’m a dick”
- joshlemer 5y agoI actually really don't mind Java-the-language all that much, in fact I'd say I think it's pretty great. My problem with Java is that the ecosystem and culture of Java tend to leaning heavily on annotations for everything. It's not just Spring (though this is probably the worst offender) but everything from Configurations and Command-Line Parsing to DB access and connections, testing, serialization, it seems like overwhelmingly the community leans towards annotations for everything which to me makes working with the tools really difficult to discover and even more difficult to control or modify. There are some exceptions like Vertx.io for instance which are plain-code baed but I find working in a "Java shop" you are usually pushing against the grain if you're trying to avoid Spring/Hibernate/Jackson/etc.
- debug-desperado 5y agoThe problem is that without annotations, injecting behavior or doing any sort of metaprogramming is nigh impossible. Higher-order functions aren't fun to deal with in Java, even in the post-Java-8 world.
- zmmmmm 5y agoA little tongue in cheek, but the strength of Java is that you don't have to actually use it to work in the Java ecosystem. Here is the entire program to copy stdin to stdout in Groovy: System.out << System.in
- panny 5y agoIOUtils.copy(System.in, System.out) What do I win?
- rotifer 5y agoYou have an unnecessary dependency... :-) System.in.transferTo(System.out);
- panny 5y ago>Since: >9 Cool. I didn't know about that one. I also learned about the new system logger since log4shell happened. I should make a project to see how much I can do with just the Java standard library in 17. Maybe I don't need any dependencies.
- pendar747 5y agoOne of my favorites articles ever, finally found something that expresses why java is such a boring and inadequate tool for tackling most problems
- penlightment 5y agoThe verbosity and high level of abstraction due to being fully OO, makes me feel like Trypophobia.
- DeathArrow 5y agoMy 2 cents: Too much OOP forced upon you. Too much boilerplate. Too much verbosity.