View Single Post
  #14 (permalink)  
Old 02-10-2010, 07:49 AM
none
Guest
 
Posts: n/a
Default Re: Classes named CFoo (was Re: Odd Exception Behavior)

Jorgen Grahn wrote:

> On Thu, 2010-02-04, none wrote:
>> Alf P. Steinbach wrote:

> ...
>>> * "C"-prefix for a class is a Microsoft-ism, therefore (almost
>>> automatically)
>>> ungood.

>>
>> Guilty as charged. I've been using the "C" prefix since the early days
>> of Visual Studio.

>
> More generally: I see this class CFoo scheme in a lot of postings
> here. Why do people use it, *really*?


....

> Are there broken tools in Microsoft-land which require it?
> Misinformation in popular books? What?



It's not that Microsoft's tools *require* it, it's that they *generate* it.
Lots of newbies get their start in C++ using Visual Studio. If you use any
of their predefined project types (like MFC dialog), Visual Studio will
generate lots of code to get you started, and all the classes will be named
like:

CMyFirstProgram
CMyFirstProgramApp
CMyFirstProgramDialog

.... so yo get roped into it and you barely even realize it. If you were
really determined, you could go through every line of the generated code
and remove the "C" prefixes, but that's not a trivial task for a newbie.
Reply With Quote