RonRon

My feedback

  1. 955 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      17 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
      RonRon supported this idea  · 
      RonRon commented  · 

      I was inspired by mabster's blog post. Here is my proposed syntax for static extension methods (on types), static extension properties (on types), and extension properties.

      // type extension method
      // Pro: goes well with existing extension method
      // Pro: goes well with proposed type extension property syntax
      // Con: is a weird parameter syntax that is not really a parameter
      public static int Foo3(static SomeStaticClass) { return 0; }

      // type extension property
      // Pro: goes well with existing extension method syntax
      // Pro: goes well with proposed method-style type extension method
      // Con: it makes a property look like a method; might be confusing for new users.
      public static int Foo4(static SomeStaticClass) { get { return 0; } }

      // instance extension property
      // Pro: goes well with existing extension method
      // Con: it makes a property look like a method; might be confusing for new users.
      public static int Foo5(this SomeClass c) { get { return 0; } }

    Feedback and Knowledge Base