Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. VS 2022 a genuine wow moment

VS 2022 a genuine wow moment

Scheduled Pinned Locked Moved The Lounge
visual-studiocsharpjavascriptcom
39 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • OriginalGriffO OriginalGriff

    You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

    pkfoxP Offline
    pkfoxP Offline
    pkfox
    wrote on last edited by
    #8

    I use it for my hobby projects Paul and find it good - but I've never known a bad release of VS

    Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP

    1 Reply Last reply
    0
    • D dan sh

      I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit

      // Replace all the commas that are between double quotes
      char[] linechars = line.ToCharArray();
      bool isInQuotes = false;

      for (int i = 0; i < linechars.Length; i++)
      {
      if (linechars[i] == '"')//This was predicted by Visual Studio

      This IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

      "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #9

      The {get; set;} auto-complete is great, and yes, the prediction is 80% amazing and 20% annoying in my experience. And the annoying isn't too annoying.

      dan!sh wrote:

      I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

      Well, in my experience, paying attention to code quality, no matter the requirements, always pays off. ;P Converting the string to a char array and then iterating over it with a for loop is a bit like walking away from the pilot seat without setting the auto-pilot. :laugh:

      Latest Article:
      Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain

      Greg UtasG 1 Reply Last reply
      0
      • M Marc Clifton

        The {get; set;} auto-complete is great, and yes, the prediction is 80% amazing and 20% annoying in my experience. And the annoying isn't too annoying.

        dan!sh wrote:

        I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

        Well, in my experience, paying attention to code quality, no matter the requirements, always pays off. ;P Converting the string to a char array and then iterating over it with a for loop is a bit like walking away from the pilot seat without setting the auto-pilot. :laugh:

        Latest Article:
        Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain

        Greg UtasG Offline
        Greg UtasG Offline
        Greg Utas
        wrote on last edited by
        #10

        Perhaps you or someone else can explain this {get; set;} thing to me. There are times when having a getter is appropriate, but far fewer times when having a setter is appropriate. I'm surprised that they make it so easy to mindlessly provide one.

        Robust Services Core | Software Techniques for Lemmings | Articles
        The fox knows many things, but the hedgehog knows one big thing.

        <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
        <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

        M M 2 Replies Last reply
        0
        • OriginalGriffO OriginalGriff

          You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          C Offline
          C Offline
          Calin Negru
          wrote on last edited by
          #11

          nice, soon you will only need to write the first half of your program, the IDE will figure out the other half on his own

          OriginalGriffO 1 Reply Last reply
          0
          • C Calin Negru

            nice, soon you will only need to write the first half of your program, the IDE will figure out the other half on his own

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #12

            :laugh: It's not quite that good, but if you do something like this:

            var bananas = Fruit.GetFruits(Color.Yellow);

            Then later in the method type foreach(it will autofill with this:

            foreach(var f in bananas)

            If (as I much prefer) you use an explicit type:

            List bananas = Fruit.GetFruits(Color.Yellow);

            Then the autofill is explicit as well:

            foreach(Fruit fruit in bananas)

            All on a single TAB press. Once you are used to it, it takes the typing out of the simple stuff, and it leaves you free to concentrate on the "why" you are doing it, instead of the "what".

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            C 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              C Offline
              C Offline
              Calin Negru
              wrote on last edited by
              #13

              I this thing does everything for you soon no knowledge of programing will be required to write a program.

              L OriginalGriffO 2 Replies Last reply
              0
              • C Calin Negru

                I this thing does everything for you soon no knowledge of programing will be required to write a program.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #14

                There are plenty of people who already think that is true.

                1 Reply Last reply
                0
                • C Calin Negru

                  I this thing does everything for you soon no knowledge of programing will be required to write a program.

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #15

                  There are enough people trying to produce code without any knowledge or thought already: check out QA some day ... :sigh:

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  1 Reply Last reply
                  0
                  • D dan sh

                    I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit

                    // Replace all the commas that are between double quotes
                    char[] linechars = line.ToCharArray();
                    bool isInQuotes = false;

                    for (int i = 0; i < linechars.Length; i++)
                    {
                    if (linechars[i] == '"')//This was predicted by Visual Studio

                    This IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

                    "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                    D Offline
                    D Offline
                    dandy72
                    wrote on last edited by
                    #16

                    Now redo another block of code, but change "commas" in your comment to something else...then as you're typing the actual code, see if it picks up what your comment said as you're suggesting...

                    D 1 Reply Last reply
                    0
                    • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                      It is amazing... until it is not... Wait and see - after enough suggestions you will find that most of them are plain stupid repetition of what you done before (a true no-brain op)...

                      “Real stupidity beats artificial intelligence every time.” ― Terry Pratchett, Hogfather

                      D Offline
                      D Offline
                      Dan Neely
                      wrote on last edited by
                      #17

                      Kornfeld Eliyahu Peter wrote:

                      Wait and see - after enough suggestions you will find that most of them are plain stupid repetition of what you done before (a true no-brain op)...

                      I had more obviously wrong suggestions than cases where it generated what I wanted, but that's not why I turned it off after a few weeks. I pulled the plug because about 5-10% of the suggestions were dangerously wrong. Things that looked OK at first glance, but which had subtle logic errors in them. Trying to debug my own wrong think is bad enough, when the code running is ever so slightly off of what I intended was far worse.

                      Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius

                      M 1 Reply Last reply
                      0
                      • D dandy72

                        Now redo another block of code, but change "commas" in your comment to something else...then as you're typing the actual code, see if it picks up what your comment said as you're suggesting...

                        D Offline
                        D Offline
                        dan sh
                        wrote on last edited by
                        #18

                        Yes it does! It does not figure what the new condition should be but it at least does not recommend checking for quote. I love VS. Mostly due to other IDEs I need to use.

                        "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                        1 Reply Last reply
                        0
                        • D dan sh

                          I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit

                          // Replace all the commas that are between double quotes
                          char[] linechars = line.ToCharArray();
                          bool isInQuotes = false;

                          for (int i = 0; i < linechars.Length; i++)
                          {
                          if (linechars[i] == '"')//This was predicted by Visual Studio

                          This IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

                          "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                          D Offline
                          D Offline
                          Daniel Pfeffer
                          wrote on last edited by
                          #19

                          With the possible exception of auto-complete for method names etc., I distrust such suggestions. No IDE, irrespective of how much "AI" it is using, can truly understand my thought processes.

                          Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                          K 1 Reply Last reply
                          0
                          • D Daniel Pfeffer

                            With the possible exception of auto-complete for method names etc., I distrust such suggestions. No IDE, irrespective of how much "AI" it is using, can truly understand my thought processes.

                            Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                            K Offline
                            K Offline
                            k5054
                            wrote on last edited by
                            #20

                            Is that a reflection of the state of AI, or your thought processes, I wonder.

                            Keep Calm and Carry On

                            D 1 Reply Last reply
                            0
                            • Greg UtasG Greg Utas

                              Perhaps you or someone else can explain this {get; set;} thing to me. There are times when having a getter is appropriate, but far fewer times when having a setter is appropriate. I'm surprised that they make it so easy to mindlessly provide one.

                              Robust Services Core | Software Techniques for Lemmings | Articles
                              The fox knows many things, but the hedgehog knows one big thing.

                              M Offline
                              M Offline
                              Marc Clifton
                              wrote on last edited by
                              #21

                              Greg Utas wrote:

                              There are times when having a getter is appropriate, but far fewer times when having a setter is appropriate. I'm surprised that they make it so easy to mindlessly provide one.

                              Agreed, however in the 99% of the cases that I work with, I'm either serializing/deserializing JSON or working with EF or Linq2SQL, both of which require setters on the model.

                              Latest Article:
                              Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain

                              1 Reply Last reply
                              0
                              • K k5054

                                Is that a reflection of the state of AI, or your thought processes, I wonder.

                                Keep Calm and Carry On

                                D Offline
                                D Offline
                                Daniel Pfeffer
                                wrote on last edited by
                                #22

                                Yes. :|

                                Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                                1 Reply Last reply
                                0
                                • OriginalGriffO OriginalGriff

                                  :laugh: It's not quite that good, but if you do something like this:

                                  var bananas = Fruit.GetFruits(Color.Yellow);

                                  Then later in the method type foreach(it will autofill with this:

                                  foreach(var f in bananas)

                                  If (as I much prefer) you use an explicit type:

                                  List bananas = Fruit.GetFruits(Color.Yellow);

                                  Then the autofill is explicit as well:

                                  foreach(Fruit fruit in bananas)

                                  All on a single TAB press. Once you are used to it, it takes the typing out of the simple stuff, and it leaves you free to concentrate on the "why" you are doing it, instead of the "what".

                                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                                  C Offline
                                  C Offline
                                  Calin Negru
                                  wrote on last edited by
                                  #23

                                  It comes a bit difficult to think in C# terms but I`ll try How about the situation when you have so many fruits that they won`t fit in a single list. We are talking about a huge amount of fruits, all of the same type. So you would have to use lists of lists or lists of lists of lists.

                                  List> lemons = Fruit.GetFruitsLists(Color.Yellow);

                                  can autocomplete deal with that? [edit] ok it`s a bit of a wild guess on my behalf, I just don`t know if what I`m saying is correct but if you have a huge number of fruits, all of them rather small in dimension would you keep a single list containing all of them thus resulting a huge solid blob of memory difficult to maneuver, or, second option, partition them into multiple lists which would make a more flexible solution from the memory usage perspective.

                                  OriginalGriffO M 4 Replies Last reply
                                  0
                                  • C Calin Negru

                                    It comes a bit difficult to think in C# terms but I`ll try How about the situation when you have so many fruits that they won`t fit in a single list. We are talking about a huge amount of fruits, all of the same type. So you would have to use lists of lists or lists of lists of lists.

                                    List> lemons = Fruit.GetFruitsLists(Color.Yellow);

                                    can autocomplete deal with that? [edit] ok it`s a bit of a wild guess on my behalf, I just don`t know if what I`m saying is correct but if you have a huge number of fruits, all of them rather small in dimension would you keep a single list containing all of them thus resulting a huge solid blob of memory difficult to maneuver, or, second option, partition them into multiple lists which would make a more flexible solution from the memory usage perspective.

                                    OriginalGriffO Offline
                                    OriginalGriffO Offline
                                    OriginalGriff
                                    wrote on last edited by
                                    #24

                                    I would suspect so, but I'm on a tablet at the moment, and don't have VS 2022 installed on it. I'll check tomorrow when I'm back on the desktop.

                                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                    1 Reply Last reply
                                    0
                                    • C Calin Negru

                                      It comes a bit difficult to think in C# terms but I`ll try How about the situation when you have so many fruits that they won`t fit in a single list. We are talking about a huge amount of fruits, all of the same type. So you would have to use lists of lists or lists of lists of lists.

                                      List> lemons = Fruit.GetFruitsLists(Color.Yellow);

                                      can autocomplete deal with that? [edit] ok it`s a bit of a wild guess on my behalf, I just don`t know if what I`m saying is correct but if you have a huge number of fruits, all of them rather small in dimension would you keep a single list containing all of them thus resulting a huge solid blob of memory difficult to maneuver, or, second option, partition them into multiple lists which would make a more flexible solution from the memory usage perspective.

                                      OriginalGriffO Offline
                                      OriginalGriffO Offline
                                      OriginalGriff
                                      wrote on last edited by
                                      #25

                                      The edited bit ... Whoo, that's a complicated one ... Lists are pretty efficient at what they do, but it depends on what you actually do with them - this may help: List<T> - Is it really as efficient as you probably think?[^] So a List of Lists (of lists) could be more efficient than a monolithic list. Or it could be massively inefficient if you use it badly. But remember that as it's a class the collection(s) are storing, the memory occupied is the same whether it's an instance or a collection that it holds - the memory for the actual instance will be exactly the same size and number regardless, so nested collections may take up slightly more memory than a single one because of the extra references to collections involved. But only if you let the big one grow to size - otherwise the "double each time it's full" part of the equation starts to consume inordinate amounts of memory (and processing time to copy across as it goes). But then when you use it, the flat model outperforms in it terms of processing, because there is less dereferencing going on. And if you start storing the Fruit as a struct rather than a class to save space and dereferencing, you introduce a whole new kettle of fish because the size of the Fruit starts to impact space and processing when you copy it each time (value types) instead of copying the reference alone. And ... there is a limit on the size of the monolithic collection because of the .NET limit on max size of any one item, and an array of structs is a single chunk of memory n * sizeof(Fruit) bytes long instead of n * 4 or n * 8 bytes long for an array / list of references. Again, this might help: Using struct and class - what's that all about?[^] It's never as simple as it seems, is it? :laugh: [edit] Second link changed - I forgot to CTRL+C before pasting ... :-O [/edit]

                                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it sh

                                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                      C 1 Reply Last reply
                                      0
                                      • C Calin Negru

                                        It comes a bit difficult to think in C# terms but I`ll try How about the situation when you have so many fruits that they won`t fit in a single list. We are talking about a huge amount of fruits, all of the same type. So you would have to use lists of lists or lists of lists of lists.

                                        List> lemons = Fruit.GetFruitsLists(Color.Yellow);

                                        can autocomplete deal with that? [edit] ok it`s a bit of a wild guess on my behalf, I just don`t know if what I`m saying is correct but if you have a huge number of fruits, all of them rather small in dimension would you keep a single list containing all of them thus resulting a huge solid blob of memory difficult to maneuver, or, second option, partition them into multiple lists which would make a more flexible solution from the memory usage perspective.

                                        OriginalGriffO Offline
                                        OriginalGriffO Offline
                                        OriginalGriff
                                        wrote on last edited by
                                        #26

                                        Interestingly, if you use var it copes quite well. If you use an explicit type, it doesn't suggest anything. And now, a few minutes later it doesn't cope at all ... but the GetFruits example yesterday does ... VS has just updated itself, that may be the reason. I'll try a shut down and restart of the whole PC to clear out any "old bits" it may still have running later.

                                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                        1 Reply Last reply
                                        0
                                        • D dan sh

                                          I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit

                                          // Replace all the commas that are between double quotes
                                          char[] linechars = line.ToCharArray();
                                          bool isInQuotes = false;

                                          for (int i = 0; i < linechars.Length; i++)
                                          {
                                          if (linechars[i] == '"')//This was predicted by Visual Studio

                                          This IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.

                                          "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                                          M Offline
                                          M Offline
                                          maze3
                                          wrote on last edited by
                                          #27

                                          im still annoyed with auto double quotes have string need to setup, value from excel for example

                                          var myString =

                                          go and copy value and paste in

                                          var myString = fancyLongvalue_that i dont want to type out

                                          now need to wrap in quote

                                          var myString = ""fancyLongvalue_that i dont want to type out

                                          😒 type one double quote and gives me two, kinda like hidden clippy somewhere "oh you want string, take two" ok, well delete the second, and move to end of line to add closing quote

                                          var myString = "fancyLongvalue_that i dont want to type out""

                                          😡fancy auto complete but still thinking I want a second quote when already warning with a bunch of error due to first quote

                                          M 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups