Re: [linux-audio-dev] (OT) C++ flame war

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] (OT) C++ flame war
From: Erik de Castro Lopo (erikd-lad@mega-nerd.com)
Date: Thu Feb 06 2003 - 03:38:10 EET


On Thu, 06 Feb 2003 01:04:33 +0100
Martijn Sipkema <msipkema@sipkema-digital.com> wrote:

> You are not forced to define the private data members and functions at the
> same time as the public ones in C++. The way to handle this is to put the public
> interface in a pure virtual class:

In my opinion (please note that this IS an opinion) the method you propose
is at least as ugly as any other way of keeping a class's private data members
private. IMO, using C and doing

    typedef void Object ;

    Object * Object_new (/* parameters */) ;

    int method_1 (Object *object, /* parameters */) ;

    void Object_delete (void) ;

and then using a struct (return a pointer to it from Object_new()) in the
implementation file is neater and works better.

If you think C++ is great, then you are entitled to your opinion. In my
experience, the C++ boosters are far pushier with their form of religion
than the people who prefer C to C++.

> I think most of the arguments in the article are not valid,

Most of the arguments or just the ones relating to C++? I did talk about
stuff other than C++ in that article.

> It can't hurt for to also hear some positive comments on C++ occasionally
> though...

I think C++ gets more that its fair share of the lime light. I am simply
trying to show that

   1) C++ is not the only solution.
   2) OO can be done in Standard C.
   3) Some people (me included) might prefer doing OO programing in C
      rather than C++.

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
Hiesenbugs - The bugs that go away when you turn on debugging.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Feb 06 2003 - 03:45:08 EET