<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.18.3">
</HEAD>
<BODY>
On Wed, 2008-08-06 at 14:15 -0700, Kevin Scaldeferri wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
> I'm not sure I agree with the statement quoted by Michael that FP
> doesn't have the shortcomings of OO so GoF-like patterns aren't
> necessary.
</PRE>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
Yeah, functional programming has _different_ patterns, not no
patterns. And, in some sense they also highlight shortcomings.
</PRE>
</BLOCKQUOTE>
<PRE>
</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
For example, functional languages typically do not have lists that you
can append to efficiently, so we need the "Accumulate and Reverse"
pattern.
</PRE>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
Erlang doesn't allow you to enumerate the messages a process can
receive, so we have a "Hide Message-Passing Behind Functions" pattern.
</PRE>
</BLOCKQUOTE>
<BR>
These would fall more under the heading of "idioms" than GoF-style patterns in my books (although the latter of the two is in the same grey space I mention below). The equivalent in C++, to contrast to the GoF-style patterns, would be the use of auto_ptr in functions to make up for C++'s lack of decent memory management. Some of the GoF patterns (I'm looking at you here, Singleton!) verge on the idiom level, but in general they're architectural constructs, not coding tricks.<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> <<A HREF="mailto:ttmrichter@gmail.com">ttmrichter@gmail.com</A>> (<B>GoogleTalk:</B> ttmrichter@gmail.com)<BR>
<I>We should sell bloat credits, the way the government sells pollution credits. Everybody's assigned a certain amount of bloat, and if they go over, they have to purchase bloat credits from some other group that's been more careful. (Bent Hagemark)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>