www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/02/16:32:32

From: "Ole Laursen" <ole_laursen AT hardworking DOT dk>
Newsgroups: comp.os.msdos.djgpp
References: <3 DOT 0 DOT 32 DOT 19990801181614 DOT 007b9130 AT mail DOT colba DOT net> <37a5e4a8 AT news DOT ismi DOT net>
Subject: Re: BITMAP pointers w/ Allegro.
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <Z3np3.154$z4.3489@news020.image.dk>
Date: Mon, 2 Aug 1999 22:16:08 +0200
NNTP-Posting-Host: 212.54.77.135
X-Complaints-To: news-abuse AT wol DOT dk
X-Trace: news020.image.dk 933625209 212.54.77.135 (Mon, 02 Aug 1999 22:20:09 MET DST)
NNTP-Posting-Date: Mon, 02 Aug 1999 22:20:09 MET DST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019