Re: Polymorphism sucks [Was: Paradigms which way to go?]
- From: Tim Rentsch <txr@xxxxxxxxxxxxxxxxxxx>
- Date: 12 Jun 2005 19:58:47 -0700
CTips <ctips@xxxxxxxxxxx> writes:
> topmind wrote:
> <snip>
> > OO is good for .... shapes.
> >
>
> Not really. Anytime someone comes up with the shapes example, ask them
> how they would add the method:
>
> class shape {
> // true if object has any points in common with <B>
> boolean intersects(shape B);
> }
>
> See how quickly mind-lock sets in....
I believe this criticism is not a fair comment.
The reason that this problem is difficult is that intersection on
general shapes -- with no restrictions on what kinds of shapes might
be intersected -- is non-obvious whether objects are used or not.
Using OO techniques doesn't automatically confer a deep understanding
of the problem domain.
A better test would be to take someone who understands the problem of
shape intersection (and is agnostic about objects) write code to
perform shape intersection using both an OO approach and a non-OO
approach, and compare the results.
.
- References:
- Re: Paradigms which way to go?
- From: Phlip
- Re: Paradigms which way to go?
- From: Rich
- Re: Paradigms which way to go?
- From: Phlip
- Re: Paradigms which way to go?
- From: Gerry Quinn
- Re: Paradigms which way to go?
- Prev by Date: Re: Suggestions for double-hashing scheme
- Next by Date: Re: puzzle
- Previous by thread: Re: Paradigms which way to go?
- Next by thread: Re: Paradigms which way to go?
- Index(es):