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 8255141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:25:29+00:00 2026-06-08T01:25:29+00:00

Many of the BCL Classes have Methods and ExtensionMethods. What is the design decision

  • 0

Many of the BCL Classes have Methods and ExtensionMethods. What is the design decision to pick ExtensionMethods over Methods when Microsoft has the source code of their Class?
Thank you,
Smith

  • 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-06-08T01:25:30+00:00Added an answer on June 8, 2026 at 1:25 am

    Actually most of the extension methods in the BCL apply not to classes, but to interfaces, which is a key power of extension methods.

    For example, almost all of LINQ to objects is implemented as extensions to the IEnumerable<T> interface, and not to the classes List<T>, HashSet<T>, etc.

    Because interfaces do not have functionality (just a contract), adding an extension method to a interface gives you a way to an interface itself. This is especially handy when the implementation need only know of the interface for it’s use and not implementation specifics (per se).

    Microsoft does add new methods in their BCL classes all the time (though of course they avoid breaking changes wherever possible). But I believe the majority of their extension method use in the BCL is on interfaces and not for adding functionality that could easily be added with a new method directly to the class/struct.

    So, in short, when Microsoft chooses to add functionality to a single class (or family with a common base class), they’d probably just add the method directly (all things being equal), but if they wanted to apply a new method to all implementations of a given interface, they’d probably use an extension method on that interface.

    Also keep in mind this! Because Microsoft gave us extension methods, it applies to classes they didn’t create as well! For example, any class that you create that implements IEnumerable<T> gets the functionality of LINQ as well as a bonus, even though you inherit no common base classes, etc.

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

Sidebar

Related Questions

Many methods in the BCL are marked with the [MethodImpl(MethodImplOptions.InternalCall)] attribute. This indicates that
many Places in the sample code i have seen 2 different way of @synthesize
Many of my classes require access to a database to do their work. For
Many html page has an url link to the RSS feed. If you have
Many network protocols have their own rfc(request for comment), like this one for http/1.1:
Many times in open source codes of django python , I have seen the
Many threads have access to summary . Each thread will have an unique key
Many ARIA demonstration websites use code such as: <label for=name id=label-name>Your Name</label> <input id=name
Many times I get quick page design inputs from business/clients which will be finally
Many open source projects use a Configuration class and lambda's to clarify configuring a

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.