PhilippePhilippe

My feedback

  1. 15 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…)
      1 comment  ·  Visual Studio IDE » IDE and Editor  ·  Flag idea as inappropriate…  ·  Admin →
      PhilippePhilippe commented  · 

      Well, it would be even better if the IDE would also be able to format documentation comments instead of showing XML directly.

      But I think that usually it would be nice to show first line anyway (as it is done for documentation comments). An alternative display would be to put a comment icon at the beginning of the line.

      And since we are taking about comment formatting, then having some styling options would be nice.

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

        Well this goes again the general idea of C# where even visibility is repeated for each declaration. And if at some point, you refactor the code so that the class is not static anymore, you would have to update any existing member.

      • 2 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…)
          1 comment  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
          PhilippePhilippe commented  · 

          You almost want to do the same thing in get and set and when you do something, it might be conditional (if the value was changed/initialized) or it might be useful to know the old value.

          By the way in C# 7, you can now use => for get/set so you can reduce code for trivial cases.

        • 2 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…)
            1 comment  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
            PhilippePhilippe commented  · 

            Being able to return void is useless except in generic code... but then void would have to be supported as a type in those cases. And given how generic code works and related restriction, I do not think that it would be possible without major changes. And then at that point, there would be many more features that would be much more useful than that.

            For other proposed keyword, it is hard to understand either what they do or what would be the advantage as it does increase the language complexity with marginal benefit if any.

          • 3 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…)
              1 comment  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
              PhilippePhilippe commented  · 

              In my opinion, this add little benefit while making the code harder to understand as you have to know more language construct.

              And although, your sample code might works nice the first time, at some point while maintaining the code, you might realize that you don't want to always execute the code inside finally block or that you want to execute it even if the preceding code was not executed.

              So I do thing that using the "done" flag is still the best solution although that in some case it might make sense to move the code inside a function and simply return a boolean indicating if the condition was verified.

            • 1 vote
              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…)
                0 comments  ·  Visual Studio IDE » NuGet Package Manager  ·  Flag idea as inappropriate…  ·  Admin →
                PhilippePhilippe shared this idea  · 
              • 3 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…)
                  2 comments  ·  Visual Studio IDE » NuGet Package Manager  ·  Flag idea as inappropriate…  ·  Admin →
                  PhilippePhilippe commented  · 

                  I would expect some ranking so top items would typically be the best match for the query. Thus if all words are present, it would be near the top of the list.

                • 682 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…)
                    10 comments  ·  Visual Studio IDE » IDE and Editor  ·  Flag idea as inappropriate…  ·  Admin →
                    PhilippePhilippe supported this idea  · 
                  • 1 vote
                    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…)
                      1 comment  ·  Visual Studio IDE » User Interface  ·  Flag idea as inappropriate…  ·  Admin →
                      PhilippePhilippe commented  · 

                      Saying that F1 is useless is plainly wrong. Often you get exactly the information you need and in many cases there are samples.

                      And in some cases, you can indicate if you find the resulting page useful. At some point, I think it was even possible for the community to add their own comments. I don't know if that possibility was removed...

                      By the way, it would be useful if you would show a few example where F1 is problematic. In fact, Visual Studio support many languages, librairies and frameworks and the help usefulness might vary somewhat depending on the area you work on.

                      In my case, I do mainly C# development in which case the help is quite good often with appropriate samples.

                      However having another shortcut (maybe Ctrl+Shift+F1) that would display a form to search the web with some user-definable patterns would be nice.

                    • 76 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…)
                        5 comments  ·  Visual Studio IDE » User Interface  ·  Flag idea as inappropriate…  ·  Admin →
                        PhilippePhilippe commented  · 

                        I also have that problem and would like it to be fixed.

                      • 9 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…)
                          2 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                          PhilippePhilippe commented  · 

                          Currently, writing a # is very annoying in Visual Studio 2015 as it mess up every region afterward.

                          1 #region --- first region --- typically indented
                          2 # <--- Writing this
                          3 #endregion

                          As soon as # is inserted on line 2, #region on line 3 get undented and stay that way. Since I use Visual Studio 2015, I spent too much time reformatting the code. Visual Studio get it right when we first write the code but mess everything when editing an existing file.

                          An additional option might be welcome but they have to fix that kind of issue.

                          In fact, I would like that formatting would only apply to code before the cursor. We, humans, write code from left to right. The fact the IDE try to take into account text after the cursor is often annoying when we insert code.

                          The same issue also apply to IntelliSense. Many edition are hard to do because of the way Roslyn handle edition. Older version of Visual Studio were way better at handling edition when the code is invalid.

                        • 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 →
                            PhilippePhilippe commented  · 

                            Although in general, I would recommend to add a parameter of type Func<string, int, T> for creation, it won't hurt if Generics would be made more flexible.

                            They are quite limited compared to say C++ templates and even compared to new Apple Swift language.

                          • 4,018 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…)
                              2 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                              PhilippePhilippe commented  · 

                              This should be fixed. As some other feature that are supported by both standard C++ and by C#, it is hard to understand why it won't works in C++/CLI.

                              As far as I know, this is supported in the CLR so it should be simple the compiler to generated the proper metadata. By the way, if I remember well, the other way also need to be fixed when using C# code from C++/CLI...

                            • 1 vote
                              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…)
                                1 comment  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                PhilippePhilippe commented  · 

                                Although if would be nice if switch was more flexible as in some other languages (F#, Swift...), in that case, this is typically a poor design. You should usually either use virtual functions or a visitor pattern for that purpose.

                              • 1 vote
                                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…)
                                  3 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                  PhilippePhilippe commented  · 

                                  This is not a bug. It works according to C++ standard.

                                • 3,247 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 →
                                  • 310 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…)
                                      4 comments  ·  Visual Studio IDE » Languages - F# Tools  ·  Flag idea as inappropriate…  ·  Admin →
                                      PhilippePhilippe supported this idea  · 
                                      PhilippePhilippe commented  · 

                                      This is also a problem between C++/CLI and C#. What we really need is that whenever the target assembly is part of the projet that the appropriate source code (not metadata nor object browser) is displayed.

                                      It should not be that hard as the debugger is able to figure out which line to display when one debug an application built using multiple languages.

                                      I think that part of the problem is that presently each source language decide which target it support for that command. Obviously, it should be the target assembly language that should find the definition.

                                      By the way not only "Find reference" should works across language but also refactoring like renaming a property.

                                    • 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 →
                                        PhilippePhilippe commented  · 

                                        Another thing... Now that ?. operator has been added, it would give contrary views of the problem. On one hand we make it easier to write code that handle null and on the other hand, we want to avoid the possibility to have null references.

                                        Given the wide use of C#, if non null reference is added to the language, I think it should be optional as readonly and other modifiers.

                                        And also would it be possible to write generic code that works appropriately in both cases? It is already hard to write generic code because it is much less flexible than C++ templates.

                                        For example, for container that allows to specify an initial size including built-in arrays, what would be the initial value of each item? would default(T!) give a new T? If so the type must support default new. Existing container don't have such restriction and it is not possible to vary those clause depending on the type...

                                        Or would some member functions have additional restrictions. Maybe such fonctions should then be annotated to indicate that they are only available for type that can be default construct.

                                        Thus it might be preferable to support metaprogramming first in the language... but then would you want to go as far as C++?

                                        PhilippePhilippe commented  · 

                                        While it might be nice to add non-nullable reference, they should not be the default.

                                        One might argue that it would be the best default. Assuming it was a new language, then probably. At this point, it would be a major breaking change. So much code has been written with that assumption.

                                        It could be explicit using either ! notation or a NotNull attribute or some "required" modifier.

                                        Beyond the fact that it would break too much code, another reason why non null reference should not be the default, is for consistency with other features that do not have the best default according to the point of view of what would typically lead to the best design.

                                        If non null reference would be the default, then readonly, const and pure functions should also be the default...

                                        On the other hand, if non null reference support is added, then having an attribute (or modifier) that allows it the default on a per type basis might make sense.

                                        Also, such changes would have impact on generic code. How function like TryGetValue should works? I guess one would have to use a temporary nullable reference in that case and initialize a non null reference from it after ensuring it is not null.

                                        However, it is not possible to write a function similar to TryGetValue that would works on non nullable types. That is, it would returns false and the compiler would known that the variable should be used only when the function returns true. Thus extra attributes (or even some form of advanced conditionnal code contract) would be required...

                                      • 49 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…)
                                          4 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                                          PhilippePhilippe commented  · 

                                          I agree that it would be nice to support the "value" syntax for native object inside a managed class and have the compiler generate appropriate code.

                                          It would also be nice if classes like unique_pointer would be extended to properly works with managed types. In fact the whole STL should have been done that way instead of a STL.NET that was late and unusable).

                                          In fact, it look like when C++/CLI was designed (for Visual Studio 2005) that the team was not STL expert as otherwise they would have made the language in a way that it would have been possible to use almost the whole STL on native type, managed class types and managed value types...

                                          By the way things like lambda, function objects and all that stuff should works using the same library in a transparent way and template code written by the user should also works on both managed and native type (if it works with pointer and value type).

                                          Because of the poor design of C++/CLI, it is very complicated to use managed type for code that was written for native types.

                                          It would have been much better if managed handle would use pointer syntax and only the declaration of the class would have a modifier.

                                          Presently only in marginal case the effect is similar. For example, one could put a managed type "on the stack" to have it automatically disposed at the end of scope or one could call delete operator on managed types. Even the use of gcnew is stupid in that context as it make it almost impossible to write template code that works with both native pointers and managed handles without writing a lot of extra code. This is probably one of the reason why STL.NET was a failure...

                                        • 21 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…)
                                            1 comment  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                            PhilippePhilippe commented  · 

                                            Typically one should avoid calling MoveNext()/Current and used foreach instead. In that case, this would not works.

                                            However, it would be quite easy to do a generic class that has 2 properties : Item and Error.

                                            public class ItemOrError<T>
                                            {
                                            public ItemOrError(T item) { this.item = item; }
                                            public ItemOrError(Exception error) { Error = error; }

                                            public T Item
                                            {
                                            get { if (Error != null) throw Error; return item; }
                                            }

                                            public Exception Error { get; private set; }

                                            private T item;
                                            }

                                            To generate and error one would write yield return new ItemOrError<T>(new Exception());

                                            That solution is far better because it return an explicite proxy and the user will not be surprise that the iteration could throw... The use of ItemOrError class would clearly show that the collection can throw errors...

                                            It is very weird to have an enumeration that would throw on some items. Usually, you either want to skip bas items in which case the caller would never see the problem or thrown an exception and the caller stop enumerating items because of the exception.

                                            For the rare case where it would be useful to throw exception for some items, the a solution like mine would be appropriate.

                                            Also throwing a lot of exception from a loop can have a serious impact on performance... and thus again my approach would be better.

                                            I really don't think that the langage should be make more complicated for features like that that almost nobody would use and understand.

                                          ← Previous 1

                                          Feedback and Knowledge Base