Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe09.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Passing a Method Name to a Method References: <81h4075t4gfjglji1n033rb20025ebho68@4ax.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 30 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Thu, 23 Jun 2011 19:23:51 UTC Organization: Public Usenet Newsgroup Access Date: Thu, 23 Jun 2011 16:23:49 -0300 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5597 On 11-06-23 03:32 PM, markspace wrote: > On 6/23/2011 10:42 AM, Fuschia, President-Elect of the Bright >> >> I'll just mention here that functional programming, in this case at >> least, also gives the advantages given by object oriented programming; >> specifically, you can add another parse method by adding another (third) >> parse *function* without changing most of the other code. And generally > > > I'll just mention here that this is fairly specious. A proper OO > solution, like the ones I gave, you can add another parser just by > adding the appropriate class. The boiler plate is about two lines. Leaving aside the actual parsing code, none of the possible solutions involve changing much code. The question is only where the code needs to be changed. >> while writing a lot less boilerplate code than Java requires, with one >> interface, plus one class skeleton around each parse function, plus >> relevant imports and type declarations here and there. > > > The interface is already done, skeleton, imports, etc are already done. > Just add a class with a method. What you gain in Java is type safety, > something not available in the "functional" languages I'm familiar with. Good thing you used the double quotes...because the functional languages I'm familiar with do have type safety. AHS