Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4537484
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:40:55+00:00 2026-05-21T14:40:55+00:00

I have a co-worker who uses a C# refactoring tool. The tool for some

  • 0

I have a co-worker who uses a C# refactoring tool. The tool for some reason perfers:

this.Foo()

over

Foo()

Now we’ve asked him to turn it off simply because it’s annoying to have all the code re-written automatically, but that’s not the point.

Am I missing something, or is this just wrong? Why on earth would I want this.Foo()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:40:55+00:00Added an answer on May 21, 2026 at 2:40 pm

    As other answers here point out, this is largely a matter of style.

    Many times a call to Foo() would be unambiguous without the this., but there are times where it might add clarity. For example:

    EventHandler foo = GetEventHandlerFoo();
    EventHandler baz = GetEventHandlerBar();
    foo();
    this.Bar();
    baz();
    

    In this case, the this. prefix helps to make the method invocation stand out from the delegate invocations.

    Is this necessary? No, and Lasse V. Karlsen correctly points out that the this. is just a surrogate for a naming convention that makes it unambiguous.

    But I find that I will frequently use the this.Foo prefix on local properties for a similar reason, where again it is more a matter of style.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a friendly debate with a co-worker about this. We have some thoughts about
I have a console application. A class (let's say Worker) does some work in
I have experienced a weird problem with javascript. The problem page uses some jQuery
I just saw a very odd thing, I have a co-worker who has their
In the past I've worked with a number of programmers who have worked exclusively
I have a worker thread that is listening to a TCP socket for incoming
I have a co-worker that maintains that TRUE used to be defined as 0
I have a co-worker that swears by //in a singleton Constants class public static
I have several different c# worker applications that run various continuous tasks: sending emails
I have one website on my server, and my IIS Worker Process is using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.