Re: some comments about our C++ code...


Subject: Re: some comments about our C++ code...
From: Sam TH (sam@uchicago.edu)
Date: Sun Apr 15 2001 - 17:21:08 CDT


On Sun, Apr 15, 2001 at 12:19:23PM -0700, Aaron Lehmann wrote:
> You're right on everything, except for:
>
> On Sun, Apr 15, 2001 at 05:16:31PM +0200, Joaqu?n Cuenca Abela wrote:
> > 3) Please, please, please: NO public/protected variables. Period. Try
> > to avoid public virtual members, too.
> > This one need a bit of collaboration from everybody. I will not go
> > through all the code and fix that. It should be fixed in an incremental
> > way with the help of everybody.
>
> This is crazy. Why is using foo->get_bar() better than foo->bar other
> than adding complexity and obfuscating the code?

You remember the libpng bug that I fixed more than a year ago? That
took forever to find? That was caused by accessing the internal state
of the library, instead of using accessor functions. Then, when the
library's state changed, we crashed all the time.

Data hiding is good, no matter what language you're in.
           
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dyndns.org/decss




This archive was generated by hypermail 2b25 : Sun Apr 15 2001 - 17:09:41 CDT