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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:52:49+00:00 2026-05-14T02:52:49+00:00

I find them a very natural way to extend existing classes, especially when you

  • 0

I find them a very natural way to extend existing classes, especially when you just need to “spot-weld” some functionality onto an existing class.

Microsoft says, “In general, we recommend that you implement extension methods sparingly and only when you have to.” And yet extension methods form the foundation of Linq; in fact, Linq was the reason extension methods were created.

Are there specific design criteria where using extension methods are perferred over inheritance or composition? Under what criteria are they discouraged?

  • 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-14T02:52:49+00:00Added an answer on May 14, 2026 at 2:52 am

    We show proposed new language features (at least the ones that have a halfway decent chance of seeing the light of day) to the C# MVPs for early feedback. Some feedback we get very often on many features is “well I would use this feature judiciously and in accordance with the design principles of the feature, but my goofball coworkers are going to go crazy nuts with this thing and write up a mass of unmaintainable, non-understandable code that I’m going to get stuck with debugging for the next ten years, so as much as I want it, please never implement this feature!”

    Though I am exaggerating somewhat for comedic effect, this is something we take very seriously; we want the design of new features to encourage their use but discourage their misuse.

    We worried that extension methods would be used to, for example, indiscriminantly extend “object” arbitrarily and thereby create big balls of loosely typed mud that would be hard to understand, debug and maintain.

    I’m personally in particular concerned about “cute” extension methods that you see in “fluent” programming. Stuff like

    6.Times(x=>Print("hello"));
    

    Yuck. “for” loops are universally understandable and idiomatic in C#; don’t get cute.

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

Sidebar

Related Questions

I was doing some reading on enums and find them very similar to declaring
I need to be able to store objects in javascript, and access them very
I would like to find out what is the optimum way of storing some
Also, where would I find them?
What Latex styles do you use and where do you find them? The reason
How do you organize your stored procedures so you can easily find them and
I'm sure I've seen examples somewhere before, but I can't seem to find them.
Have you used the Application Recovery APIs with vista? http://msdn.microsoft.com/en-us/library/aa373347(VS.85).aspx Do you find them
jQuery selectors are wonderful, but I sometimes I find myself typing them over and
I'm trying to find all permutations of a string and sort them alphabetically. This

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.