[dba-VB] C#: this.prefix

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed Jul 2 11:57:06 CDT 2008


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




More information about the dba-VB mailing list