[dba-VB] C#: this.prefix

Charlotte Foust cfoust at infostatsystems.com
Wed Jul 2 18:37:36 CDT 2008


We use camcelcase postfix for objects and I still HATE it!  We name
things so they sort alpha but sometimes the names aren't very
illuminating until you get to the tag end, which makes it wearing to
search through the list for something you can't quite recall the name
of.  We use a variant of Hungarian within the code, although that has
become hit or miss since .Net too.

Charlotte Foust 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Wednesday, July 02, 2008 9:57 AM
To: 'Discussion concerning Visual Basic and related programming issues.'
Subject: Re: [dba-VB] C#: this.prefix

Hi Gustav,

I almost never use such prefixing - and I did use Me. a lot in VBA...

I do use full namespace prefix if needed.

Using this. prefix could disturb a lot as for C# programming is usual to
make a lot of code refactorings with moving code snippets from here to
there etc.

I do use CamelCase postfix naming convention - and it helps and works
well for me (Imagine that after almost ten years of using LNRC (and
Hungarian) naming conventions in VBA and VB6!)...

--
Shamil

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, July 02, 2008 7:55 PM
To: dba-vb at databaseadvisors.com
Subject: [dba-VB] C#: this.prefix

Hi all

How rigorously are you prefixing controls and variables with "this."?

Is it a good or bad coding practice to use it when not strictly needed?
Do I understand it right, that it is only needed to separate, say, a
method in the current namespace from an identically named and public
method in another namespace?

I've found, that I use it a lot - old habit from "Me." in VBA, I guess.

/gustav


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list