Live data from Hacker News

Reasons to use Guava

insightfullogic.com

11–20 of 50 posts

Re: Reasons to use Guava

#11
post #7
post #4

I don't follow Java development, but I have worked in it occasionally, and every time I do something in it, I'm inevitably surprised by having to use one of this commons libraries for something basic. Is there a reason some of this stuff isn't added to the base framework?

- Java has historically included things in its standard library that (presumably) everyone regrets nowadays, like CORBA support. The standard JRE is already overweight. Also keep in mind that size matters for Java - in theory, it's a client side environment that's downloaded and installed by consumers (of course, in practice nobody does that anymore). - The standard library has to be implemented by all JVM vendors, s…

Bear in mind the in-progress modularity JSR (http://jcp.org/en/jsr/detail?id=294) that might help this problem. Also, some people won't want everything that Guava provides.

Re: Reasons to use Guava

#12
post #10

Well, I recommend to move to scala language instead :)

I don't really see what this has to do with the article itself. It's totally ridiculous to compare learning a new language, developer tools etc. with adding a single library to a project. Also, Scala is specifically designed to bring many benefits at the language and library level that Guava won't.

I really find this kind of Snark disappointing on HN, and one of the many examples of a decline in the quality of comments that PG has talked about.

Re: Reasons to use Guava

#14
I am a fan of Guava, not just as a very useful library, but as a way to read really good Java code. Check the source out, it is imo a must if you are a java dev.

One thing I'm not a fan of is the functional stuff. The idea is good, but java is just too verbose. Without real lambdas, like C# has now, it ends up being not so useful.

Re: Reasons to use Guava

#15
post #14

I am a fan of Guava, not just as a very useful library, but as a way to read really good Java code. Check the source out, it is imo a must if you are a java dev. One thing I'm not a fan of is the functional stuff. The idea is good, but java is just too verbose. Without real lambdas, like C# has now, it ends up being not so useful.

I'm a big fan of the functional stuff. Writing transform statements using for loops is painful and error prone in comparison to a quick anonymous function using Collections2. Yes, it looks ugly, but at least there's less duplication, and if you're using code completion in an IDE (which you are, because it's java), it's actually faster to write.

Re: Reasons to use Guava

#16
post #10

Well, I recommend to move to scala language instead :)

I'd have to agree. One of the main benefits touted for guava in this article is the ability to use java libs with cleaner syntax. Scala already enables us to do that, and a lot more. I've coded java for the last 12 years, but have to admit there's no denying that there are cleaner ways of getting things done in Scala, Ruby, Python etc. of those 3 scala is the only one fast enough to be taken seriously.

Re: Reasons to use Guava

#17
post #2

Adding to #1 : Using static imports to import the newHashMap() method can make the statement even shorter : final Map > lookup = newHashMap(); This serves to make the code far more readable.

In bolts, it's Map > lookup = Cf.hashMap(); Which is as short and also doesn't require static imports. Bolts are the state of art FP library for java. https://bitbucket.org/stepancheg/bolts/src/tip/src/main/java... some examples in tests

Sadly not in maven repo yet so my company can't use it. I have played around some with functional java (functionaljava.org) and Op4j. Have you compared bolts to either of those?

Re: Reasons to use Guava

#19
post #12
post #10

Well, I recommend to move to scala language instead :)

I don't really see what this has to do with the article itself. It's totally ridiculous to compare learning a new language, developer tools etc. with adding a single library to a project. Also, Scala is specifically designed to bring many benefits at the language and library level that Guava won't. I really find this kind of Snark disappointing on HN, and one of the many examples of a decline in the quality of commen…

I agree with him - what Guava brings (functional programming, better safety in types) is something that is better done at language level like in Scala.

Either you like Java and you don't need Guava, or you want functional programming and other goodness and for that Scala is a better language.

Post reply on HN