Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Odd Exception Behavior

Reply
Thread Tools

Odd Exception Behavior

 
 
Jorgen Grahn
Guest
Posts: n/a
 
      02-09-2010
On Tue, 2010-02-09, Branimir Maksimovic wrote:
> Branimir Maksimovic wrote:
>> 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*?

>>
>> I beleive that C is hungarian notation. C stands for "class".
>>
>> S is for struct, I guess?


I usually don't know or care if my types are structs or classes ...

> http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx


[Coding Style Conventions]

It seems from that list that the main use of the 'C' is in
COM-infested code, where you don't want to confuse classes with COM
objects of various kinds.

(I hope this is an outdated document. I particularly strongly dislike
the file, class and method documentation headers they list further
down. They're the kind which are guaranteed to go out of sync with
reality, take up lots of screen space, and yet not say anything worth
knowing.)

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      02-09-2010
On 9 Feb, 19:48, Jorgen Grahn <(E-Mail Removed)> wrote:
> On Tue, 2010-02-09, Branimir Maksimovic wrote:
> > Branimir Maksimovic wrote:
> >> 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*?


> >> I beleive that C is hungarian notation. C stands for "class".


> >> S is for struct, I guess?


> I usually don't know or care if my types are structs or classes ...


> >http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx


> [Coding Style Conventions]


> It seems from that list that the main use of the 'C' is in
> COM-infested code, where you don't want to confuse classes
> with COM objects of various kinds.


> (I hope this is an outdated document. I particularly strongly
> dislike the file, class and method documentation headers they
> list further down. They're the kind which are guaranteed to
> go out of sync with reality, take up lots of screen space, and
> yet not say anything worth knowing.)


Note that the document doesn't say you should do it. It just
describes what is done in the samples. And in examples, there
is a (very very small) justification: names like Foo and Bar
don't give the slightest hint as to whether they're a class or a
namespace, for example. (Whereas if you need such prefixes in
production code, you should use better names.)

--
James Kanze
 
Reply With Quote
 
 
 
 
none
Guest
Posts: n/a
 
      02-10-2010
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
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Odd behavior with odd code Michael Speer C Programming 33 02-18-2007 07:31 AM
VERY odd routing behavior when attempting VPN connections over Wifi Robert Gordon Wireless Networking 0 08-25-2005 04:04 PM
Firefox under Linux -- odd behavior Dennis J. Tuchler Firefox 0 07-28-2004 04:05 PM



Advertisments