Click here to Skip to main content
15,923,120 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing name of "Open" button in OpenFileDialog Pin
Andy Moore6-Jun-05 7:58
Andy Moore6-Jun-05 7:58 
QuestionHow to update value in Hashtable Pin
Member 20184464-Jun-05 0:09
Member 20184464-Jun-05 0:09 
AnswerRe: How to update value in Hashtable Pin
Colin Angus Mackay4-Jun-05 0:22
Colin Angus Mackay4-Jun-05 0:22 
GeneralDoubt regarding usage of 'this' Pin
manivannan.p3-Jun-05 23:54
manivannan.p3-Jun-05 23:54 
GeneralRe: Doubt regarding usage of 'this' Pin
S. Senthil Kumar4-Jun-05 0:06
S. Senthil Kumar4-Jun-05 0:06 
GeneralRe: Doubt regarding usage of 'this' Pin
WillemM4-Jun-05 0:08
WillemM4-Jun-05 0:08 
GeneralRe: Doubt regarding usage of 'this' Pin
Colin Angus Mackay4-Jun-05 0:21
Colin Angus Mackay4-Jun-05 0:21 
GeneralRe: Doubt regarding usage of 'this' Pin
Carsten Zeumer4-Jun-05 7:50
Carsten Zeumer4-Jun-05 7:50 
There is no difference in the created IL code wether you use this or not.
(try Lutz Röders excelent Reflector tool to check this).
(field accesses will always resolve to a ldfld opcode and method calls to call or callvirt)

I personally changed my way of using the this keyword.
I started by not using it at all beeing happy not to have to use it as in the old c++ days...
Then i switched to use it on fields and properties. Simpy for readability.
Now i went as far as using it for method calls too.


Even though it seems a little overdone i think the code readability gains a lot.
Especially for everyone who has not written the code but is reading it.
By using the this keyword it is immediatly clear that you refere to a member of the current class.

Currrently i am not as far as using the base keyword for any derieved method.

As long as a method, field or property is not ambigious it is completely up to you and your personal style whether you use the this keyword or not.

/cadi
GeneralRe: Doubt regarding usage of 'this' Pin
Scott Serl4-Jun-05 12:08
Scott Serl4-Jun-05 12:08 
GeneralTimer message queue Pin
sammyh3-Jun-05 23:32
sammyh3-Jun-05 23:32 
GeneralRe: Timer message queue Pin
Carsten Zeumer4-Jun-05 1:39
Carsten Zeumer4-Jun-05 1:39 
GeneralRe: Timer message queue Pin
S. Senthil Kumar4-Jun-05 2:19
S. Senthil Kumar4-Jun-05 2:19 
Generala stupid and basic question about members Pin
Green Fuze3-Jun-05 23:04
Green Fuze3-Jun-05 23:04 
GeneralRe: a stupid and basic question about members Pin
S. Senthil Kumar3-Jun-05 23:26
S. Senthil Kumar3-Jun-05 23:26 
GeneralRe: a stupid and basic question about members Pin
Green Fuze5-Jun-05 5:52
Green Fuze5-Jun-05 5:52 
GeneralRe: a stupid and basic question about members Pin
WillemM4-Jun-05 0:14
WillemM4-Jun-05 0:14 
GeneralRegular expression Pin
Virendrak3-Jun-05 22:05
Virendrak3-Jun-05 22:05 
GeneralRe: Regular expression Pin
Carsten Zeumer3-Jun-05 23:42
Carsten Zeumer3-Jun-05 23:42 
GeneralRe: Regular expression Pin
Kareem Shaker4-Jun-05 23:10
Kareem Shaker4-Jun-05 23:10 
Generalstuck on an annoying problem in outlook c# Pin
ekynox3-Jun-05 21:27
ekynox3-Jun-05 21:27 
GeneralRe: stuck on an annoying problem in outlook c# Pin
S. Senthil Kumar3-Jun-05 22:14
S. Senthil Kumar3-Jun-05 22:14 
GeneralRe: stuck on an annoying problem in outlook c# Pin
ekynox3-Jun-05 22:30
ekynox3-Jun-05 22:30 
GeneralExport to excel data from ultrawebgrid each row contain one worksheet Pin
sunilmskr3-Jun-05 19:32
sunilmskr3-Jun-05 19:32 
GeneralBeginner Question C# Form1 resizing Pin
...---...3-Jun-05 18:22
...---...3-Jun-05 18:22 
GeneralRe: Beginner Question C# Form1 resizing Pin
wout de zeeuw4-Jun-05 2:25
wout de zeeuw4-Jun-05 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.