Quoth Moshe Zadka on Sat, Jul 22, 2000:
> On Sat, 22 Jul 2000, Vadim Vygonets wrote:
> > Private class members have nothing to do with API _or_
> > documentation. It just hides the internal structure.
>
> What do you mean "hides"? The private class members are right there in
> your face in the header file. Perhaps you mean "disallows access?"
Yes, sorry. This would be a much better definition.
> -- well
> that is just a form of documentation (don't use that member).
If you say so. For me, there should be a *real* documentation
saying what the API of the class is.
> If you
> simply write in the documentation "don't use that member", intellegient
> programmers won't use it. And unintellegient programmers will make stupid
> mistakes no matter how you try to protect them.
For example, one of the OSes I use defines jmp_buf as:
struct __jmp_buf {
int jb_eip;
int jb_ebx;
int jb_esp;
int jb_ebp;
int jb_esi;
int jb_edi;
int jb_mask;
int jb_pad[3]; /* preserve historical mistake */
};
typedef struct __jmp_buf jmp_buf[1];
I haven't sene many programmers who go and fiddle with struct
__jmp_buf instead of using setjmp/longjmp. Another OS defines
jmp_buf even better:
typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1];
Vadik.
--
Bell Labs Unix -- Reach out and grep someone.
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]