comp.lang.ada
 help / color / mirror / Atom feed
From: "E. Robert Tisdale" <edwin@netwood.net>
Subject: Re: How to Design an Application Programmers' Interface (API)
Date: 2000/08/13
Date: 2000-08-13T00:00:00+00:00	[thread overview]
Message-ID: <3996BFCE.662A8DFC@netwood.net> (raw)
In-Reply-To: 3996C42F.2713C90A@flash.net

Gregory Pietsch wrote:

> Of course not.  It was never an OOP language.
>
> That's because we C programmers don't even WANT
> any mechanism for hiding the data members.

They certainly do.

> In other words,
> a union of the real type with an array of int (or char) the same size?

No.
There are two definitions -- one private and one public.
Only library functions have access to the private type definition.
Application programs can only include the public type definition.

> Seems a little complicated.  Why don't I just write the program?

It isn't complicated.
You just write the program which 'include's the library header file.
When you've finished debugging and testing your program,
you simply define a C preprocessor macro
which selects the static inline functions
instead of the external library function prototypes and you recompile.

> Fine.  Whenever I write C++ programs, I'll avoid adding get/set methods.
>
> This is getting into OO philosophy more than anything.

No.  It's not just philosophy.
It's just good design practice.  Until you understand that,
you won't be a competent programmer in ANY language.






  reply	other threads:[~2000-08-13  0:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-10  0:00 How to Design an Application Programmers' Interface (API) E. Robert Tisdale
2000-08-10  0:00 ` Jack Klein
2000-08-10  0:00 ` Kaz Kylheku
2000-08-10  0:00   ` E. Robert Tisdale
2000-08-10  0:00     ` vrml3d.com
2000-08-10  0:00       ` Tony T. Warnock
2000-08-10  0:00         ` Toon Moene
2000-08-10  0:00         ` Keith Thompson
2000-08-10  0:00           ` E. Robert Tisdale
2000-08-10  0:00             ` Keith Thompson
2000-08-10  0:00               ` E. Robert Tisdale
2000-08-10  0:00                 ` Keith Thompson
2000-08-11  0:00                   ` David Botton
2000-08-11  0:00                 ` David Gillon
2000-08-11  0:00                   ` Peter S. Shenkin
2000-08-10  0:00       ` E. Robert Tisdale
2000-08-11  0:00 ` E. Robert Tisdale
2000-08-11  0:00   ` Larry Kilgallen
2000-08-11  0:00     ` E. Robert Tisdale
2000-08-11  0:00       ` Larry Kilgallen
2000-08-11  0:00         ` E. Robert Tisdale
2000-08-11  0:00   ` Gautier
2000-08-11  0:00     ` E. Robert Tisdale
2000-08-11  0:00       ` Gautier
2000-08-11  0:00         ` E. Robert Tisdale
2000-08-11  0:00       ` Interfacing to Numerical Programming libraries (was: How to Design..) Larry Kilgallen
2000-08-12  0:00         ` E. Robert Tisdale
2000-08-12  0:00           ` tmoran
2000-08-12  0:00             ` E. Robert Tisdale
2000-08-12  0:00         ` Sam Hobbs
2000-08-13  0:00   ` How to Design an Application Programmers' Interface (API) E. Robert Tisdale
2000-08-13  0:00     ` Larry Kilgallen
2000-08-13  0:00     ` Gregory Pietsch
2000-08-13  0:00       ` E. Robert Tisdale [this message]
2000-08-13  0:00         ` Brendan Sechter
2000-08-13  0:00         ` Larry Kilgallen
2000-08-13  0:00         ` Gregory Pietsch
2000-08-13  0:00           ` E. Robert Tisdale
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox