From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 24117BBC4 for ; Tue, 31 Mar 2009 05:06:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8BAHYl0UlCbwQbdWdsb2JhbACWAAEMCgkJEQS0CoN6Bg X-IronPort-AV: E=Sophos;i="4.38,450,1233529200"; d="scan'208";a="25309763" Received: from out3.smtp.messagingengine.com ([66.111.4.27]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 Mar 2009 05:06:00 +0200 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 6CC2330B8E4; Mon, 30 Mar 2009 23:05:59 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 30 Mar 2009 23:05:59 -0400 X-Sasl-enc: U+kvWjr+Y247gD8W0S5iHZ3hfC0CGsEBDHxlMZ7B/XeP 1238468759 Received: from [192.168.1.10] (ALyon-157-1-87-173.w90-37.abo.wanadoo.fr [90.37.198.173]) by mail.messagingengine.com (Postfix) with ESMTPSA id BF85B3C6C3; Mon, 30 Mar 2009 23:05:58 -0400 (EDT) Message-ID: <49D187D3.9090108@ens-lyon.org> Date: Tue, 31 Mar 2009 05:02:43 +0200 From: Martin Jambon User-Agent: Thunderbird 2.0.0.17 (X11/20081008) MIME-Version: 1.0 To: Alexy Khrabrov Cc: OCaml Subject: Re: [Caml-list] when OO is wrong References: <0DEB4DD9-13C5-4CC5-A916-A18BB6B9DAEB@gmail.com> In-Reply-To: <0DEB4DD9-13C5-4CC5-A916-A18BB6B9DAEB@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ens-lyon:01 conceptually:01 summarize:01 wrote:01 caml-list:01 functions:01 jambon:01 jambon:01 interfaces:01 prefixes:01 data:02 define:02 modules:02 output:02 objects:02 Alexy Khrabrov wrote: > What is it about FP which makes modeling simpler than OO, conceptually > and technically? How can folks summarize their "enlightenment" > experiences in this regard? OO is not dirty. Wait until you feel it's the right time and do it safely ;-) Objects and classes tend to be more appropriate than modules and records in the following cases: - self-centric data that can be considered as a "resource", typically for IO operations. - frequent need to define and use interfaces before implementations. - keeping familiar names for functions/methods without requiring disambiguation prefixes ("input", "output", "print", "flush", "read", "send", etc.) Martin -- http://mjambon.com/