[gmpi] Re: Coding Conventions

  • From: "Ron Kuper" <RonKuper@xxxxxxxxxxxx>
  • To: <gmpi@xxxxxxxxxxxxx>
  • Date: Thu, 10 Feb 2005 13:55:29 -0500

>>>
Seriously, when one chooses to ignore a perfectly valid (and arguably
self-documenting) way of avoiding a problem, can you feel bad for them?
<<<

By putting this-> in front of every data member you are throwing away
the expressive power of objects and the namespaces they represent.  Do
you also preface member function (method) calls with this-> too?  Where
does it stop?

I get the sense that whatever exposure you've had to C++, it's been from
the perspective of "C on steroids."  In C, this->value is a logical
replacement for my_object->value.  But in C++ "this" has a lot more
significance, in a good way.

>>>
This being an API, we should be as explicit as possible at all turns.
<<<

In the API, sure.  The API is going to be C so coding conventions for
C++ don't really apply.

However, we'll be writing other code, I good amount of it in C++ most
likely.  I don't intend to write the GMPI/DX wrapper in C, and you can
be sure I'm not going to put "this->" in front of every data member.
I'm going to write C++ the way it's written in the real world.  In the
real world we use other conventions for data members, like lowercase,
underscore or m_.

>>>
I've been tracking a thread recently of people being bitten by some
bizarre rules of templatized classes being subclassed ...
<<<

Like any powerful tool, templates have their dangers and can be easily
misunderstood or misused.  Then again STL is all about templates, and I
would hope our sample code makes good use of STL.

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: