Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Passing a Method Name to a Method Date: Thu, 23 Jun 2011 11:32:19 -0700 Organization: A noiseless patient Spider Lines: 25 Message-ID: References: <81h4075t4gfjglji1n033rb20025ebho68@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 23 Jun 2011 18:32:22 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="20GYBuezvHpp83lA3Rh62Q"; logging-data="32213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l4VyBk2ktoGa7HcXdrQGP8Dr/FaiJGu8=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:bQoM95gazkTHCe7tnWLTU0IrpeU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5596 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. > 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.