JMCF125JMCF125

My feedback

  1. 187 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…)
      19 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
      JMCF125JMCF125 commented  · 

      params IEnumerable<T> on its own would be fine by me. Every custom list-like type I've created so far derives at the very least from it, so the autoimatic mplicit cast makes my original idea possible.

      JMCF125JMCF125 commented  · 

      Some of the members of List<T> are outside those (althought extension methods in System.Linq.Enumerable class complement them, but not completely). And what if someone makes another list-like class, which I consider relatively frequent, how will that person be able to simply write the mebers to make a new list?

      Of course it's possible, the purpose is to add a bit of syntatic sugar, like operators. Yes, we all know we could have int.Add(int.Add(a, b) ,c) to add the 32 bit integers a, b and c, however, we all prefer to use a + b + c.

      JMCF125JMCF125 supported this idea  · 
      JMCF125JMCF125 commented  · 

      The benefit is inside the method; you can use all members of whatever list-like type you're using.

      JMCF125JMCF125 commented  · 

      A solution looking for a problem? How?

      JMCF125JMCF125 commented  · 

      What the **** happened to all the votes???

      JMCF125JMCF125 commented  · 

      Looks like someone just added 3 for your -3.

      JMCF125JMCF125 commented  · 

      "Why should I need...": that's an hateful anti-progressive argument. Why should you need classes? You can write it all with simple intructions in assembly language. The purpose of classes is to simplify your work. I could generalize: many great ideas came from the pettiest things. This is an extreme example, I'm not saying params for lists is even NEARLY as important as classes, but it is a simple little tool like many others.

      These small tools are the ones that make a language. "Oh, we don't need this and that, so lets remove it." In the end you get a toolbox with a hammer but no nails. Good small things make a great big language.

      If this is about the immutability of the elements of the list, there's a propertie in System.Collections.Genric.ICollection<T> called IsReadOnly. If you try to reassign such object, an error will come up.

      JMCF125JMCF125 commented  · 

      Yes, you're right, it would be too expensive that way. However, couldn't the List<T> be converted to an array (since the System.Array type derives at least from System.Collections.IList) in which the elements would be created (like in your 1st example, for IEnumerable<int>) and then be converted back to IList<T>?

      Yet rejecting that hypothesis, you could at least accept, as you said, the IEnumerable and IEnumerable<T>. Is that ok?

      JMCF125JMCF125 commented  · 

      @Mirality, I see your point, but that way your not taking advantage of the 'params' modifier. I mean, with a method like this:

      SomeType DoSomething(params ListType list){...}

      Doing this:

      SomeType a = DoSomething(_1stElement, _2ndElement, etc.);

      Instead of this:

      ListType l = new ListType();
      l.Add(_1stElement);
      l.Add(_2ndElement);
      ...
      SomeType b = DoSomething(l);

      Being all of the parameters of DoSomething (the following: _1stElement, _2ndElement, etc.) "addable" (with Add method of IList<T> or IList) to the list. Now compare the 2 ways of applying the method. Which one do you prefer? I certanly prefer the first, although they do basicallly the same. In the way you said it, it would be impossible. That's why I want to make it possible, it's just better.

      Any replies to the post or the comment itself, please post them.

      JMCF125JMCF125 shared this idea  · 
    • 502 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…)
        8 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
        JMCF125JMCF125 commented  · 

        It's funny, you know, I had thought of this some time ago and I got persuaded to the opposite (see this: http://social.msdn.microsoft.com/Forums/nl/csharpgeneral/thread/6618afba-9cad-4322-a5f3-e4391ae35f03). Indeed, I now look at this in a different way than back then. It doesn't sound very good nor helpful.

      • 215 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…)
          8 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
          JMCF125JMCF125 supported this idea  · 
          JMCF125JMCF125 commented  · 

          I don't know why isn't this idea already applied.

        • 5,209 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…)
            92 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
            JMCF125JMCF125 commented  · 

            Check out Sasa (download here: http://sourceforge.net/projects/sasa/), with non-null types, option types (might be null), extension methods for anything... Take a look in here: (http://higherlogics.blogspot.pt/2010/12/sasa-v093-released.html) as well.

            JMCF125JMCF125 supported this idea  · 
          • 249 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…)
              15 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
              JMCF125JMCF125 commented  · 

              "you can't put reference values into a Nullable<T>". Yes, I knew that, yet my objective was to enable Nullable<T> to do so, by making changes to the CLR.
              I'm now using Nullable<Option<T>> value;.
              Thank you for your help!
              I have already posted this in http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2cb7f451-bd56-480d-970b-ddb241889099.
              Should I remove this idea since it is now proved to be a question?

              JMCF125JMCF125 commented  · 

              I really need this.
              I've been stuck from progress for a long time.
              I'm yet trying to find this miraculous ToNullable<T> type.

              JMCF125JMCF125 commented  · 

              Thank you Mauricio.
              I want to use SASA butI can't find this ToNullable type. Is there any manual or something I could use to find it?

              JMCF125JMCF125 commented  · 

              That's what I wanted: "use Nullable<T> without regard for the type of T". Of course "HasValue" property would be changed too.

              JMCF125JMCF125 commented  · 

              This is something I need, and I haven't found a solution.
              The problem is posted in this forum:
              http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2cb7f451-bd56-480d-970b-ddb241889099.

              Take a look and comment either here or there what you think.

              JMCF125JMCF125 commented  · 

              I used the $ sign to show ToNullable<T> could be used as Nullable<T>, however another symbol, like § could be used.

              In my example, I wanted to make sure value is nullable, but I don't know if it alredy is. If it is, nothing changes, if it isn't, it is turned into nullable.

              Nullable<T> gives error, because the value may alredy be null, so I'd use ToNullable<T>, that makes sure the value is null. Therefore, I can assign the value to null.

              JMCF125JMCF125 commented  · 

              This has some ortografic errors, but I can't edit them.

              JMCF125JMCF125 shared this idea  · 
            • 114 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…)
                8 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                JMCF125JMCF125 commented  · 

                I agree, writing xml comments in visual c# is almost like writing them in notepad.

                JMCF125JMCF125 supported this idea  · 
              • 157 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…)
                  45 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                  JMCF125JMCF125 commented  · 

                  I disagree.
                  but you can warn with #warning or you can add /**<exception>ExceptionName - Description</exception>**/

                • 3,186 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…)
                    34 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                    JMCF125JMCF125 supported this idea  · 

                  Feedback and Knowledge Base