Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Sun, 11 Sep 2011 10:55:25 -0400 From: =?ISO-8859-1?Q?Arne_Vajh=F8j?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Style Police (a rant) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 32 Message-ID: <4e6ccbde$0$314$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 72.192.23.141 X-Trace: news.sunsite.dk DXC=<;Z3j2P72KY@?0gJFJ]ae[YSB=nbEKnk[ITj3b>UHiWPJPe3\kP5EUQKBm9cfh9BSTM2;kT<[:>[QgG>WW\g^0mT?IIU6M Lew wrote: >> Andreas Leitgeb wrote: >>> I'd favor a different change: let final variables optionally >>> have their type inferred: >>> final myList = new ArrayList(); >>> Afterall, it is just a handle for some previously obtained value. >> That idea is more complex than it appears. Should the inferred type be >> 'List', 'AbstractList' or 'ArrayList'? >> I suspect you would say the last, > > You suspected right, which is no surprise, as it is the only reasonable > choice in that particular context. > >> but really, is it so very, very bad to type >> final List myList = new ArrayList<>(); > > I find the direction of the inferral somewhat unlucky. > I'd rather infer the type from right(expression) to left(variable), > than the other way round. I guess that was discussed thoroughly > before it was introduced, so I might just miss knowing those perfect > arguments against my preferrence. I prefer the Java way. I believe in some cases you just want to read the left side and then move further down the code. Having to read the right side to see what type it is will just make it more difficult (in that case). Arne