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.
  • 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
    Matt Bond
    wrote on last edited by
    #30

    Just add "private" in front of "set;". Then you can set the value internally to your class but not from outside the class. The getter would have the same access as the property itself.

    Bond Keep all things as simple as possible, but no simpler. -said someone, somewhere

    1 Reply Last reply
    0
    • D Dan Neely

      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 Offline
      M Offline
      Member 110323
      wrote on last edited by
      #31

      I've found that most of the suggestions (80%+) are exactly what I wanted to do. I've been pretty wowed by the technology. Maybe it's because it's looking over my shoulder and learning from a truly great programming master ;-)

      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[^]

        S Offline
        S Offline
        Steve Naidamast
        wrote on last edited by
        #32

        Yes, another convenience that will allow developers to think less...

        Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          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

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

          Thanks for explaining

          Quote:

          Second link changed - I forgot to CTRL+C before pasting ...

          just noticed your edit. I think public logging of edit time would make a nice CP feature.

          OriginalGriffO 1 Reply Last reply
          0
          • C Calin Negru

            Thanks for explaining

            Quote:

            Second link changed - I forgot to CTRL+C before pasting ...

            just noticed your edit. I think public logging of edit time would make a nice CP feature.

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

            Calin Cali wrote:

            I think public logging of edit time would make a nice CP feature.

            You mean like the "modified 20hrs ago." text at the bottom of the message? :laugh:

            "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
            • 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

              L Offline
              L Offline
              Lance Milleson
              wrote on last edited by
              #35

              80% of my code is "plain stupid repetition of what [I've] done before"

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                Calin Cali wrote:

                I think public logging of edit time would make a nice CP feature.

                You mean like the "modified 20hrs ago." text at the bottom of the message? :laugh:

                "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
                #36

                Quote:

                You mean like the "modified 20hrs ago."

                (only if you knew what you are talking about) yeah, with a small font and in brackets.

                1 Reply Last reply
                0
                • M Matt Bond

                  I've never had so much data that I had to be concerned with splitting my List<> objects. However, I have had a need for List> before because of the nature of the data. Think of the outer list being for all car manufacturers while each inner list is for each car model they make. Because of how my database data was structured, this made more sense at the time. I could have used linq to combine all car lists into a single list, but it wasn't necessary.

                  Bond Keep all things as simple as possible, but no simpler. -said someone, somewhere

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

                  Quote:

                  Think of the outer list being for all car manufacturers while each inner list is for each car model they make

                  Yeah you could push that logic even further by making 'car model' a list on its own containing all the car model parts (for a car service shop use for instance). List in a list saves you sorting time but a list is just a container it doesn`t provide any clue about what`s inside other than it`s name so you need to keep a separate account about the list tree structure, levels if the tree is rather deep/complex.

                  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[^]

                    T Offline
                    T Offline
                    Thornik
                    wrote on last edited by
                    #38

                    One line of "something predicted"?? Are you seriously make thing named "programming" or you just tap keys??

                    1 Reply Last reply
                    0
                    • M maze3

                      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 Offline
                      M Offline
                      markchagers
                      wrote on last edited by
                      #39

                      try selecting the pasted value and then type a double quote. Alternatively, first type the double quote and then paste.

                      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