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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:10:15+00:00 2026-06-03T03:10:15+00:00

When it comes to extension methods class names seem to do nothing, but provide

  • 0

When it comes to extension methods class names seem to do nothing, but provide a grouping which is what name-spaces do. As soon as I include the namespace I get all the extension methods in the namespace. So my question comes down to this: Is there some value I can get from the extension methods being in the static class?

I realize it is a compiler requirement for them to be put into a static class, but it seems like from an organizational perspective it would be reasonable for it to be legal to allow extension methods to be defined in name-spaces without classes surrounding them. Rephrasing the above question another way: Is there any practical benefit or help in some scenario I get as a developer from having extension methods attached to the class vs. attached to the namespace?

I’m basically just looking to gain some intuition, confirmation, or insight – I suspect it’s may be that it was easiest to implement extension methods that way and wasn’t worth the time to allow extension methods to exist on their own in name-spaces.

  • 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-03T03:10:15+00:00Added an answer on June 3, 2026 at 3:10 am

    Perhaps you will find a satisfactory answer in Eric Lippert’s blog post Why Doesn’t C# Implement “Top Level” Methods? (in turn prompted by SO question Why C# is not allowing non-member functions like C++), whence (my emphasis):

    I am asked “why doesn’t C# implement feature X?” all the time. The
    answer is always the same: because no one ever designed, specified,
    implemented, tested, documented and shipped that feature. All six of
    those things are necessary to make a feature happen. All of them cost
    huge amounts of time, effort and money. Features are not cheap, and we
    try very hard to make sure that we are only shipping those features
    which give the best possible benefits to our users given our
    constrained time, effort and money budgets.

    I understand that such a general answer probably does not address the
    specific question.

    In this particular case, the clear user benefit was in the past not
    large enough to justify the complications to the language which would
    ensue. By restricting how different language entities nest inside each
    other we (1) restrict legal programs to be in a common, easily
    understood style, and (2) make it possible to define “identifier
    lookup” rules which are comprehensible, specifiable, implementable,
    testable and documentable.

    By restricting method bodies to always be inside a struct or class, we make it easier to reason about the meaning of an unqualified
    identifier used in an invocation context; such a thing is always an
    invocable member of the current type (or a base type).

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

Sidebar

Related Questions

I'm using Joomla jQuery Registration extension which comes without any kind of botcheck feature
I am writing codes for a Chrome extension that needs to access minus.com, which
Rails comes with a handy session hash into which we can cram stuff to
Django comes with CSRF protection middleware , which generates a unique per-session token for
Rails comes with RESTful resources out of the box, but do you use those
PHP ships with various methods of identifying the type of a file, but is
I have written some extension methods for UrlHelper in order to more easily load
I've been playing with collections and threading and came across the nifty extension methods
I have a class that I use for the checking method arguments, which you
I was working with the generic class in vb.net. And it seems extension method

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.