Version française
Home     About     Download     Resources     Contact us    
Browse thread
Objects, dynamic cast, Obj.magic abuse and dragons
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Berke Durak <berke.durak@e...>
Subject: Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons
Richard Jones a écrit :
> On Tue, Feb 26, 2008 at 03:28:01PM +0100, Berke Durak wrote:
>> Your solution first seemed like a kludge but, given the alternatives, it 
>> appears to be the best solution.
> [...]
>> And it's reasonably efficient (after all, we're using objects here.)
> 
> Yeah, I suspect the real lesson here is don't use objects at all.
> They are rarely as useful as people make out, and most uses of them
> seem to be because lesser languages lack good compiler checks on
> variants.  After all, there's no real problem at all spreading match
> statements around the program if I can be sure that the compiler will
> highlight everywhere which needs to change when I change my variant.
> 
> Rich.
> 

Subtyping is useful, however. I dont use objects much and I was wondering
if I'm missing much.  Toda I'd be willing to trade in the class system for
an extensible record system.
-- 
Berke DURAK