Live data from Hacker News

Reasons to use Guava

insightfullogic.com

31–40 of 50 posts

Re: Reasons to use Guava

#31
post #29

Earlier quoted context omitted.

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.

Nine times out of ten I'm looking at something like this.

http://jaydonnell.com/blog/2011/08/07/is-your-idea-clearly-e...

Re: Reasons to use Guava

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

It's instructive for all programmers (not just Java) because it's a beautifully designed API.

It's really difficult to design a good API and Guava didn't get to be like this overnight. It was used internally at google for years then spent years as a pre-1.0 open source project.

Re: Reasons to use Guava

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

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

The fact that you need an IDE to handle all the boilerplate for you should indicate the language is too verbose. In fact I feel like that's what it means for a language to be too verbose.

You should read this: http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.ht...

Re: Reasons to use Guava

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

It's instructive for all programmers (not just Java) because it's a beautifully designed API. It's really difficult to design a good API and Guava didn't get to be like this overnight. It was used internally at google for years then spent years as a pre-1.0 open source project.

Check out GWT code too, similar writing and design style.

On thr other hand, I always have to pause and think a littlr bit longer when using the Guava PreConditions.checkArgument call (even the author of Guava admitted that too)

Re: Reasons to use Guava

#35
post #33

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…

> 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. The fact that you need an IDE to handle all the boilerplate for you should indicate the language is too verbose. In fact I feel like that's what it means for a language to be too verbose. You should read this: http://steve-yegg…

That is like saying a carpenter doesn't need a hammer. An IDE is just a tool for doing your job. You don't actually need an IDE to write Java, but it sure makes it a lot easier to build a house.

Re: Reasons to use Guava

#36
post #28

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…

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)

Show me the source of both of them.

Re: Reasons to use Guava

#37
post #29

Earlier quoted context omitted.

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.

Agreed. I spend way more time in the debugger in CoffeeScript than I do with Java, simply because I have no idea what type of object I'm dealing with at that particular instant. I also tend to write pages of Java code and it runs the first time because I can read it and see exactly what it is doing before it runs. The compiler also tells me what typos I have in my code before I even have to run it.

Re: Reasons to use Guava

#38
post #33

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. The fact that you need an IDE to handle all the boilerplate for you should indicate the language is too verbose. In fact I feel like that's what it means for a language to be too verbose. You should read this: http://steve-yegg…

That is like saying a carpenter doesn't need a hammer. An IDE is just a tool for doing your job. You don't actually need an IDE to write Java, but it sure makes it a lot easier to build a house.

> You don't actually need an IDE to write Java

Correct. You don't actually need an IDE to write Java but unless you have one you're going to be writing a lot of boilerplate by hand. That is the point I am making. The language is verbose whether or not you have an IDE. The IDE simply helps you manage that verbosity.

Re: Reasons to use Guava

#39

Earlier quoted context omitted.

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.

Agreed. I spend way more time in the debugger in CoffeeScript than I do with Java, simply because I have no idea what type of object I'm dealing with at that particular instant. I also tend to write pages of Java code and it runs the first time because I can read it and see exactly what it is doing before it runs. The compiler also tells me what typos I have in my code before I even have to run it.

I don't buy this for a second for many reasons. First, in Java I have to deal with a lot of other headaches. Heaven forbid I have to customize maven! Or, I'm using some annotation based framework, let's say jax-rs, and I'm trying to figure out why the annotations I'm putting on something aren't having the effect I think they should be having. Then there is the fact that my java project will likely have more lines of xml than lines of code in the equivalent ruby project.

But, at the end of the day I'll bet money that I can write a non trivial website faster with rails using notepad than the vast majority of java people can with their favorite IDE and java framework.

Re: Reasons to use Guava

#40
post #13

Java 7 also adds java.util.Objects, which contains hashcode() and other useful methods: http://download.oracle.com/javase/7/docs/api/java/util/Objec...

It's going to be a mess with imports for those who need to use both com.google.common.base.Objects and java.util.Objects...
Post reply on HN