Mail Archives: djgpp/1999/08/02/16:32:32
> I've got a question about that, I was asking around on IRC about this
> problem and they said that its improper programming practice (wow that's
> hard to say) to have the return value of a function be a pointer. They
said
> that it violates the law of encapsulation. But I've noticed that the
> Allegro library does it all the time with BITMAP structures, is that
bad?
You (or should I say they) just can't generalize like that - it depends on
the situation. In Allegro's case I can't remember any of such function
right now, other than load_bmp and create_bitmap which can be thought of as
a constructor (thus it has to be like that, and it is good).
And that it should violate the law of encapsulation - hmm... I think they
were thinking about something slightly different, maybe.
--
Ole Laursen - http://sunsite.auc.dk/olau/
Row, row, row your boat, gently down the streeaam (gee!)
- Raw text -