«« Next » « Previous
«« Next » « Previous

Link Details

Step 1: Login - Step 2: Vote! Login and vote now.
Link 83656 thumbnail

By ailon
via devblog.ailon.org
Published: May 29 2008 / 14:14

Every time I read a C# book or an article or just a code sample in MSDN I can't stop wondering why don't people use this qualifier unless it's absolutely required? What do we sacrifice code readability for?
  • 8
  • 6
  • 902
  • 391

Comments

Add your comment
User 282119 avatar

Rob Signorelli replied ago:

0 votes Vote down Vote up Reply

I gotta agree with some of the comments on the page and not the article. I'll take a good "m_variable" over "this.variable" any day. First you don't get bombarded with highlighted keywords in your IDE for every simple variable reference (since 'this' is a keyword). Syntax highlighting is nice, but I don't want my methods looking like Vegas billboards. Also you eliminate the careless mistake of accidentally defining a local variable with the same name as an instance variable; creating a tricky to debug issue. Plus fewer keystrokes and it's less to read.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.