[Exceptional C++ Style] Fw: const data - was Item 17

Jon Jagger jon at jaggersoft.com
Mon Dec 20 12:03:30 EST 2004


Balog Pal wrote:

>>> The class in question represents a grammar. It contains one (const) 
>>> data
>>> member for every non-terminal contained in the grammar. A grammar
>>> typically contains several hundred non-terminals. The file itself is
>>> generated by another program. The whole grammar is constant and 
>>> contains
>>> no behaviour in and of itself. It is simply a large and reasonably
>>> intricately structured bit of constant data.
>>
>>
>> So, Jon's point was NOT about public data in general.
>
>
> And I'm very glad to see this. :)  

...Nice post snipped...

>
> Example 17-b in the item is supposedly a case of good, encapsulated data.
> Too bad it really isn't.  And showing it that way, can be well 
> misleading.
> The problem with logic is subtle: we have 2 candidates, show some 
> problems
> with one, and jump to conclusion the other is good. Without first looking
> after the alternatives cover the whole universe. 


I don't have a copy of the book (I've sort of been co-erced into the 
group by Paul ;-).
Would it be ok to show me 17-a and 17-b? I won't be able to get a copy 
of the book for a while now...

Cheers
Jon






More information about the Effective-cpp mailing list