Re: Coding Conventions for C#
From: mikeb (mailbox.google_at_mailnull.com)
Date: 02/26/04
- Next message: TPS: "Users are timing out, even while they work"
- Previous message: Jerry Camel: "Re: Stop aborting my thread!"
- In reply to: Andrea Williams: "Coding Conventions for C#"
- Next in thread: Andrea Williams: "Re: Coding Conventions for C#"
- Reply: Andrea Williams: "Re: Coding Conventions for C#"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 16:42:29 -0800
Andrea Williams wrote:
> Responding to this link in an old thread:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
> ml/cpconnetframeworkdesignguidelines.asp
>
> According to that naming convention, a parameter should be be named like
> this "typeName" (ei stringFirstName). The types that they list add to the
> variable name and the amount of typing to do by quite a lot when compounded
> by the amount of code that goesinto creating an app. Is there anyone still
> using the hungarian convention or a variation of it?
I think you're getting a bit confused on what they're advocating - they
don't suggest prefixing parameter names with the type of the parameter.
Note that in the example they give, the typeName parameter is a string
type, but they didn't call it stringName.
The guidelines explicitly say:
================================================
Use names that describe a parameter's meaning rather than names that
describe a parameter's type. Development tools should provide meaningful
information about a parameter's type. Therefore, a parameter's name can
be put to better use by describing meaning. Use type-based parameter
names sparingly and only where it is appropriate.
================================================
>
> Even though the hungarian convention is supposedly no longer considered good
> in the Naming Conventions for Microsoft, I'm considering using it just to
> cut down and the amount of typing. Any programmer is going to know what it
> means and it will cut down on the amount of code.
>
> Maybe there's a good reason for typing out the whole data type word,
> anyone??
>
> I would also prefer to perfix private members with something. VB used "m_"
> and it looks like c++ did as well, although it may be a little messy... I
> think I like just the underscore only, "_".
>
> Also, I believer the basic reason that the hungarian notation is out is due
> to the fact that VS.NET is strongly typed. But that only helps you IF you
> are using VS.NET. If you're using some other program, say like Notepad, you
> wouldn't have the benefit of iintellisense and I would think that the
> hungarian notation would still be valuable.
>
> Any other thoughts?
>
> I have the task of setting up our company naming and coding conventions and
> I would like extra input before I settle on one specific set of guidlines.
>
> Thanks in advance,
>
> Andrea Williams
>
>
-- mikeb
- Next message: TPS: "Users are timing out, even while they work"
- Previous message: Jerry Camel: "Re: Stop aborting my thread!"
- In reply to: Andrea Williams: "Coding Conventions for C#"
- Next in thread: Andrea Williams: "Re: Coding Conventions for C#"
- Reply: Andrea Williams: "Re: Coding Conventions for C#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|