Live data from Hacker News

Why I Like Java (2014)

blog.plover.com

141–150 of 152 posts

Re: Why I Like Java (2014)

#141
post #93
post #11

You 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…

I'm really not sure I would call Java's standard library comprehensive. I've only worked with it for a few months but needed many Apache commons libraries.

What you say is true but at the same time its one of the very few languages to include an entire cross-platform UI-Framework in the stl.

Re: Why I Like Java (2014)

#142

I 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 ove…

The 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.

Re: Why I Like Java (2014)

#145
post #11

You 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…

No isNullOrEmptyString method, no Set operations, Java didn't have a good HTTP library until Java 11, no lazy file reading, unless you use InputStream which is a pain. vast majority of mediocre libraries and one man libraries. We use Spring because it uses the best libraries, so the other ones are discarded. Java being around for so long doesn't have a lot of convenience methods like others do languages do, like the…

At last workplace we developed microservices running on Kubernetes using Redis and Postgres as databases. Integration with Elastic Search, Kibana, Datadog were a breeze.

Re: Why I Like Java (2014)

#147
post #95

I'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.

I 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.

Re: Why I Like Java (2014)

#148
post #124

Earlier quoted context omitted.

How do you measure "mediocre"? And what do you mean by inefficient? In any language you can code 99% of the things needed by 99% of most of the systems. Most of the "I love/hate this language" is usually subjective perception or strong preference for certain programming paradigms: people loving/hating OOP, people love/hating verbosity and so forth.

You don't, it's all opinion, but that doesn't mean it doesn't exist. We can at least all agree there is difference in the efficiency of writing a program in binary opcodes for a specific architecture vs writing one in C... although quantifying it is impossible, and that's just one quality.

Leaving the low level languages aside, most of the top level one can achieve the same things with similar costs. It's still up to the individual/team skill how those apps/systems end up to be built. If some project fails, is rarely "picking the wrong language" reason...

Re: Why I Like Java (2014)

#149
post #135

IOUtils.copy(System.in, System.out) What do I win?

You have an unnecessary dependency... :-) System.in.transferTo(System.out);

>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.

Re: Why I Like Java (2014)

#150

> 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…

[deleted]
Post reply on HN