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. C# autocomplete

C# autocomplete

Scheduled Pinned Locked Moved The Lounge
csharpdatabasevisual-studiotestingtools
19 Posts 15 Posters 1 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.
  • B Bruno van Dooren

    I am currently picking up an old project of mine which is basically a parser for a relatively basic code syntax for industrial automation. This is the first time I've used C# for real in many years and I've switched to VC2022, dotnet 4.8 The amount and quality of auto-complete and tab completion suggestions is... scary. To my surprise, the C# IDE understands what I am doing well enough that it literally suggested this line of code for tab completion after I typed 'if'

    if((index >= range.Start) && (index < range.End))

    I've been coding all day and it doesn't always make suggestions but when it does, they are almost always very close to what I wanted.

    G Offline
    G Offline
    Gaston Verelst
    wrote on last edited by
    #6

    "Telepatic Typing" :)

    Check out my blog at http://msdev.pro/

    1 Reply Last reply
    0
    • B Bruno van Dooren

      I am currently picking up an old project of mine which is basically a parser for a relatively basic code syntax for industrial automation. This is the first time I've used C# for real in many years and I've switched to VC2022, dotnet 4.8 The amount and quality of auto-complete and tab completion suggestions is... scary. To my surprise, the C# IDE understands what I am doing well enough that it literally suggested this line of code for tab completion after I typed 'if'

      if((index >= range.Start) && (index < range.End))

      I've been coding all day and it doesn't always make suggestions but when it does, they are almost always very close to what I wanted.

      G Online
      G Online
      GuyThiebaut
      wrote on last edited by
      #7

      Yep, the new autocomplete is damn fine - knows what I need next before I have even thought of it :laugh:

      “That which can be asserted without evidence, can be dismissed without evidence.”

      ― Christopher Hitchens

      1 Reply Last reply
      0
      • B Bruno van Dooren

        I am currently picking up an old project of mine which is basically a parser for a relatively basic code syntax for industrial automation. This is the first time I've used C# for real in many years and I've switched to VC2022, dotnet 4.8 The amount and quality of auto-complete and tab completion suggestions is... scary. To my surprise, the C# IDE understands what I am doing well enough that it literally suggested this line of code for tab completion after I typed 'if'

        if((index >= range.Start) && (index < range.End))

        I've been coding all day and it doesn't always make suggestions but when it does, they are almost always very close to what I wanted.

        S Offline
        S Offline
        Single Step Debugger
        wrote on last edited by
        #8

        I'm using VS22 on a daily basis and still cannot get used how good intelli-sense is. This is where AI really shines for me. Not trying to ChatGPT the code for me but helping with more clear syntax and typing.

        Advertise here – minimum three posts per day are guaranteed.

        1 Reply Last reply
        0
        • L Lost User

          Yes, but ... it missed the "<=" for the range end. It lulls us.

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

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

          That sort of subtle error is why I disabled the fancier auto complete stuff after a week or two. Checking for them and fixing the ones I saw took as long as manually entering the code. Debugging the ones I missed often took a lot longer because the code that was failing wasn't the same as the code I thought I'd created; and those problems normally take me longer to find than ones where it's a logic error.

          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

          1 Reply Last reply
          0
          • L Lost User

            Yes, but ... it missed the "<=" for the range end. It lulls us.

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #10

            Sort of like self driving cars? It catches even ones that you might miss but the ones it does miss can be real killers?

            1 Reply Last reply
            0
            • B Bruno van Dooren

              I am currently picking up an old project of mine which is basically a parser for a relatively basic code syntax for industrial automation. This is the first time I've used C# for real in many years and I've switched to VC2022, dotnet 4.8 The amount and quality of auto-complete and tab completion suggestions is... scary. To my surprise, the C# IDE understands what I am doing well enough that it literally suggested this line of code for tab completion after I typed 'if'

              if((index >= range.Start) && (index < range.End))

              I've been coding all day and it doesn't always make suggestions but when it does, they are almost always very close to what I wanted.

              T Offline
              T Offline
              TNCaver
              wrote on last edited by
              #11

              This feature has probably inspired more love for Visual Studio than any other in its long history.

              There are no solutions, only trade-offs.
                 - Thomas Sowell

              A day can really slip by when you're deliberately avoiding what you're supposed to do.
                 - Calvin (Bill Watterson, Calvin & Hobbes)

              1 Reply Last reply
              0
              • L Lost User

                Yes, but ... it missed the "<=" for the range end. It lulls us.

                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                E Offline
                E Offline
                englebart
                wrote on last edited by
                #12

                Some libraries use a “fake” end of list, so you would want < on those. Trying to access the end would throw an exception. Like EOF with some DB record sets.

                1 Reply Last reply
                0
                • B Bruno van Dooren

                  I am currently picking up an old project of mine which is basically a parser for a relatively basic code syntax for industrial automation. This is the first time I've used C# for real in many years and I've switched to VC2022, dotnet 4.8 The amount and quality of auto-complete and tab completion suggestions is... scary. To my surprise, the C# IDE understands what I am doing well enough that it literally suggested this line of code for tab completion after I typed 'if'

                  if((index >= range.Start) && (index < range.End))

                  I've been coding all day and it doesn't always make suggestions but when it does, they are almost always very close to what I wanted.

                  E Offline
                  E Offline
                  englebart
                  wrote on last edited by
                  #13

                  So now senior devs will have to debug all of the incorrect suggestions accepted by the nube devs.(?) Been there before…was happy when the nube decided to change groups. Eclipse has had good completion help for a long time, but many times, none of the suggestions are suitable! The nube tried to code EVERYTHING by choosing one of the suggestions.

                  B 1 Reply Last reply
                  0
                  • E englebart

                    So now senior devs will have to debug all of the incorrect suggestions accepted by the nube devs.(?) Been there before…was happy when the nube decided to change groups. Eclipse has had good completion help for a long time, but many times, none of the suggestions are suitable! The nube tried to code EVERYTHING by choosing one of the suggestions.

                    B Offline
                    B Offline
                    Bruno van Dooren
                    wrote on last edited by
                    #14

                    Having autocomplete doesn't absolve you of the need to think about what you do. From what I see, C# knows pretty well when to suggest something and when not to. And when it does, you still need to check if <= was needed instead of < etc

                    1 Reply Last reply
                    0
                    • L Lost User

                      Yes, but ... it missed the "<=" for the range end. It lulls us.

                      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                      T Offline
                      T Offline
                      the Kris
                      wrote on last edited by
                      #15

                      How did it "miss" that? That might've been the correct choice. Working with inclusive begin exclusive end ranges is the only method that works consistently without getting gaps or overlaps when using not just integers but also floats or date-times. You'll find this in many libraries, e.g. std c++ containers.

                      E 1 Reply Last reply
                      0
                      • M Marc Clifton

                        Yes, it's stunning. And also when I'm manually refactoring (meaning not search & replace) something with a repetitive change, it realizes what I'm doing so when I mouse over the next piece of code I need to change, it's often blocked in red and all I have to do is hit tab to accept the refactoring change. If you wonder why I don't just do search&replace for this kind of change, it's weird, it give my brain some breathing room to consider the question "does this change actually make sense?" There are times when I realize, nope. Ctrl+Z time, lol. One amusing note. I type so fast that often the IDE makes the correct suggestion but I'm typing furiously so I see the suggestion flash by. At which point I delete the few extra characters and start over, more slowly, so I can just hit Tab. :laugh: Not sure that's very productive.

                        Latest Articles:
                        A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                        B Offline
                        B Offline
                        BryanFazekas
                        wrote on last edited by
                        #16

                        Marc Clifton wrote:

                        If you wonder why I don't just do search&replace for this kind of change, it's weird, it give my brain some breathing room to consider the question "does this change actually make sense?" There are times when I realize, nope. Ctrl+Z time, lol.

                        Ditto! Some times a global search-n-replace will do exactly what is needed, but other times? In carpentry the rule is "measure twice, cut once". In IT it should be "think twice, change once". :laugh: Ctrl-Z works ... IF the problem is caught soon enough.

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          Yes, it's stunning. And also when I'm manually refactoring (meaning not search & replace) something with a repetitive change, it realizes what I'm doing so when I mouse over the next piece of code I need to change, it's often blocked in red and all I have to do is hit tab to accept the refactoring change. If you wonder why I don't just do search&replace for this kind of change, it's weird, it give my brain some breathing room to consider the question "does this change actually make sense?" There are times when I realize, nope. Ctrl+Z time, lol. One amusing note. I type so fast that often the IDE makes the correct suggestion but I'm typing furiously so I see the suggestion flash by. At which point I delete the few extra characters and start over, more slowly, so I can just hit Tab. :laugh: Not sure that's very productive.

                          Latest Articles:
                          A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                          G Offline
                          G Offline
                          Gary Wheeler
                          wrote on last edited by
                          #17

                          Marc Clifton wrote:

                          I type so fast that often the IDE makes the correct suggestion

                          Interesting, Marc. My typing habits have altered to wait the ½ second or so for the auto-complete to appear and use it if appropriate. I've even had to disable some of the auto-completions since they were disruptive. If you have a seizure disorder the number of popups, tooltips, and other visual gewgaws in Studio these days are more than enough to trigger a grand mal episode. I develop in both C# and C++, and the C++ auto-complete is still poor in comparison. Switching to a C++ project is irritating for a while when my fingers are thinking "c'mon, you know this crap, pop up the name already" :rolleyes:.

                          Software Zen: delete this;

                          1 Reply Last reply
                          0
                          • T the Kris

                            How did it "miss" that? That might've been the correct choice. Working with inclusive begin exclusive end ranges is the only method that works consistently without getting gaps or overlaps when using not just integers but also floats or date-times. You'll find this in many libraries, e.g. std c++ containers.

                            E Offline
                            E Offline
                            englebart
                            wrote on last edited by
                            #18

                            I was thinking of C++ std library as well. I am not sure if newer C# libraries follow C++ or not.

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              Yes, it's stunning. And also when I'm manually refactoring (meaning not search & replace) something with a repetitive change, it realizes what I'm doing so when I mouse over the next piece of code I need to change, it's often blocked in red and all I have to do is hit tab to accept the refactoring change. If you wonder why I don't just do search&replace for this kind of change, it's weird, it give my brain some breathing room to consider the question "does this change actually make sense?" There are times when I realize, nope. Ctrl+Z time, lol. One amusing note. I type so fast that often the IDE makes the correct suggestion but I'm typing furiously so I see the suggestion flash by. At which point I delete the few extra characters and start over, more slowly, so I can just hit Tab. :laugh: Not sure that's very productive.

                              Latest Articles:
                              A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

                              M Offline
                              M Offline
                              Mark Starr
                              wrote on last edited by
                              #19

                              Quote:

                              it give my brain some breathing room to consider the question "does this change actually make sense?

                              :thumbsup: Doing that gives my brain time to think through - contemplate - the ramifications of the change. Almost like a meditation. Also it let’s me see/verify exactly where the change is applied.

                              Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                              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