Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: are lambdas a way to bring functional programming to java? Date: Thu, 03 Jul 2014 10:25:47 -0700 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: <53ae08d5$0$304$14726298@news.sunsite.dk> <53ae0af4$0$302$14726298@news.sunsite.dk> <53b36e09$0$293$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 3 Jul 2014 17:25:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="10123"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xVgHp2RwtpUDfDAo/sl6DXRPZGhP1wdY=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:pLZ3PZc98qkXQPrOk7Zhq2gaA/I= Xref: csiph.com comp.lang.java.programmer:28937 On 7/3/2014 9:49 AM, Gene Wirchenko wrote: > > A fine line at times. > > In the client billing system that I wrote and maintain, I have a > lot of what most would call cut-and-paste code. They are very short > segments. In some cases, calling a properly parameterised subroutine > would take more code than the section of code that would be replaced. And I have taken short expressions with only a couple of operators, and given them their own method call, arguably taking more code (or at least line width) than the expression itself. I did it because the little buggers confused me, and giving them their own named method made the code easier to follow, not because it made the code shorter. But in the end I felt the change to a method call was totally correct. It's a fine line, and judgement and experience are important. Not to mention flexibility; Wanja's example of a shop that refused to modify its coding policy until it was obviously counterproductive (and far too late to matter) is a great example of institutional inflexibility.