Live data from Hacker News

Reasons to use Guava

insightfullogic.com

21–30 of 50 posts

Re: Reasons to use Guava

#21

Earlier quoted context omitted.

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?

As far as I know, functional java was used as inspiration, but bolts were much more suitable for day to day tasks (a lot of pragmatic code already there).

No idea about the recent development in fj, they probably made some improvements in the meantime, too.

Re: Reasons to use Guava

#23
We've started using Guava recently and one of my favorite changes is that you no longer need try/catches around string conversions in case the OS doesn't support utf-8.

Re: Reasons to use Guava

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

Sorry to have been so prompt. What I meant was "if you want more than that, I would recommand Scala".

Scala is close to Java because it compiles to JVM and you can use Java libraries in scala (so that's not a big deal to switch to it). You can nearly code in scala like in Java with some syntax improvment and in a functional way.

Re: Reasons to use Guava

#25
post #19
post #12

Earlier quoted context omitted.

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.

Exactly!

Re: Reasons to use Guava

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

The whole Java is too verbose argument is starting to sound like a broken record. With an IDE and tools like ProjectLombok around, you don't need to type much more than most other languages. I code a lot in CoffeeScript and Java and I type less in Java because at least it has static types and code completion. Try renaming a method or variable in CoffeeScript. ;-) ctrl-space (code completion) and annotations are your friends. Obviously Java8 makes the whole argument go away and now that the multi-year stalemate on Java7 is over, we know that Sunacle is focused on getting Java8 out as well.

Re: Reasons to use Guava

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

With Enumerable.java you can use Guava like this (+ static imports):

    List strings = transform(list("hello", "world"), 
        function(s, s.toUpperCase()));
    assertEquals(list("HELLO", "WORLD"), strings);
https://github.com/hraberg/enumerable

Re: Reasons to use Guava

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

The whole Java is too verbose argument is starting to sound like a broken record. With an IDE and tools like ProjectLombok around, you don't need to type much more than most other languages. I code a lot in CoffeeScript and Java and I type less in Java because at least it has static types and code completion. Try renaming a method or variable in CoffeeScript. ;-) ctrl-space (code completion) and annotations are your…

I just wrote a 300 line Java class to replace a 30 line Python script, so I don't think the criticism is unwarranted. (Python is not an official production language. And no, it's not a hidebound corp. Proposed changes need proof)

Re: Reasons to use Guava

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

The whole Java is too verbose argument is starting to sound like a broken record. With an IDE and tools like ProjectLombok around, you don't need to type much more than most other languages. I code a lot in CoffeeScript and Java and I type less in Java because at least it has static types and code completion. Try renaming a method or variable in CoffeeScript. ;-) ctrl-space (code completion) and annotations are your…

It isn't about how much you type, but how much noise your brain has to parse when you read it later.

Re: Reasons to use Guava

#30
post #29

Earlier quoted context omitted.

The whole Java is too verbose argument is starting to sound like a broken record. With an IDE and tools like ProjectLombok around, you don't need to type much more than most other languages. I code a lot in CoffeeScript and Java and I type less in Java because at least it has static types and code completion. Try renaming a method or variable in CoffeeScript. ;-) ctrl-space (code completion) and annotations are your…

It isn't about how much you type, but how much noise your brain has to parse when you read it later.

My brain has to either parse or guess every time I read JS or Ruby code due to lack of information located near the subject code.

Obviously this is a neverending debate.

Post reply on HN