Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
when OO is wrong
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] when OO is wrong
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
- 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",