From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,690ce1f62160d05a X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,690ce1f62160d05a X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,690ce1f62160d05a X-Google-Attributes: gid1014db,public X-Google-Thread: 1094ba,690ce1f62160d05a X-Google-Attributes: gid1094ba,public From: "E. Robert Tisdale" Subject: Re: How to Design an Application Programmers' Interface (API) Date: 2000/08/13 Message-ID: <3996BFCE.662A8DFC@netwood.net>#1/1 X-Deja-AN: 657816895 Content-Transfer-Encoding: 7bit References: <39921178.819F6DCB@netwood.net> <399386EF.4F2AA3E6@netwood.net> <3996456C.CAD018D5@netwood.net> <3996C42F.2713C90A@flash.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Posted via Supernews, http://www.supernews.com MIME-Version: 1.0 Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.fortran,comp.lang.ada Date: 2000-08-13T00:00:00+00:00 List-Id: 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.