Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!feeder2-2.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Immutable Datastructures with good Sharing Date: Sun, 6 Nov 2011 17:29:30 -0800 (PST) Organization: http://groups.google.com Lines: 33 Message-ID: <9709923.273.1320629370704.JavaMail.geo-discussion-forums@prhp27> References: <16628826.552.1320619468157.JavaMail.geo-discussion-forums@prlm15> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1320630924 14152 127.0.0.1 (7 Nov 2011 01:55:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Nov 2011 01:55:24 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9720 Giovanni Azua wrote: > Lew wrote: >> Giovanni Azua wrote: >>> I really enjoy the improvement in code readability as well, it suits the >>> appropriate template types e.g. >>> >>> // from >>> List requests = new ArrayList(); >>> >>> // to >>> List requests = Lists.newArrayList(); >>> >> >> I'm not saying anything against Guava, but I fail to see the advantage of that >> particular idiom. 'Lists.newArrayList' vs. 'new ArrayList<>' - eh, mezza >> mezz'. >> > I don't blame you. I had the same resistant first reaction when I was > proposed to use Guava. Then something magical happened :) I realized that > when you use new with Collections, generally you have to tell the compiler > two times what you want namely the generic parameter. I think that having to > do the same thing two times in development is always a bad thing: two times > harder to maintain, two times the amount of possible mistakes and in short, > two times the amount of work. The diamond operator mitigates that, and the two characters of it are smaller than the overhead of pulling in a whole other class. I think pulling in a whole utility class at runtime because you're too lazy to type two extra characters, or even a dozen, is silly. Roofers are laughing at your idea of too much work. But that's just me. -- Lew