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

  • SEARCH
  • Home
  • 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 94249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:28:18+00:00 2026-05-10T23:28:18+00:00

Extension method is a really helpful feature that you can add a lot of

  • 0

Extension method is a really helpful feature that you can add a lot of functions you want in any class. But I am wondering if there is any disadvantage that might bring troubles to me. Any comments or suggestions?

  • 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. 2026-05-10T23:28:19+00:00Added an answer on May 10, 2026 at 11:28 pm
    • The way that extension methods are imported (i.e. a whole namespace at a time) isn’t granular. You can’t import one extension from a namespace without getting all the rest.
    • It’s not immediately obvious from the source code where the method is defined. This is also an advantage – it means you can make your code look consistent with the rest of the methods on the type, even if you can’t put it in the same place for whatever reason. In other words, the code is simpler to understand at a high level, but more complicated in terms of exactly what’s being executed. I’d argue this is true of LINQ in general, too.
    • You can only have extension methods, not properties, indexers, operators, constructors etc.
    • If you’re extending a 3rd party class and in a later version they introduce a new method with the same signature, you won’t easily know that the meaning of your calling code has changed. If the new method is very similar to your extension, but with subtly different boundary conditions (or whatever) then this could lead to some very tricky bugs. It’s relatively unlikely to happen though.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple extension method on the int type so I can do
I need to write an extension method on a byte[]. Is that possible?
I found in MSDN's Linq samples a neat method called Fold() that I want
Is the params keyword really not supported within extension methods? I have found that
I have an extension method on the HttpApplicationState object for getting my IoC container
I'm trying to create an Extension Method for MVC's htmlHelper. The purpose is to
I'd like to write an extension method for string, which appears as a static
How do I define an Extension Method for IEnumerable<T> which returns IEnumerable<T> ? The
i'm trying to do the following extension method -> converting an int to a
I'm working on a menu-generating HtmlHelper extension method. This method will need to know

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.