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. Is ChatGPT worth the effort for a developer?

Is ChatGPT worth the effort for a developer?

Scheduled Pinned Locked Moved The Lounge
csharpcssdatabasecomperformance
32 Posts 12 Posters 2 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.
  • A Andre Oosthuizen

    As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

    Quote:

    Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

    We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

    J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #6

    Think of ChatGPT as a baby. And as a baby, it can already code some algorithmic stuff better than some devs. Guess what though... it's going to grow up eventually. Anyone who thinks AI isn't the future is going to be left behind in the dust.

    Jeremy Falcon

    1 Reply Last reply
    0
    • A Andre Oosthuizen

      As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

      Quote:

      Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

      We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

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

      "Question after question" amounts to interviewing and creating a problem definition: a first step in any sane undetaking. This gets really boring when you already know your craft and the problem domain: "teaching" the AI.

      "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

      1 Reply Last reply
      0
      • A Andre Oosthuizen

        As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

        Quote:

        Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

        We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #8

        When ChatGPT is wrong, as is often the case, it is confidently wrong, often with citations. That's why I suggest only using it on things that are immediately verifiable. Most code falls under this category, so I think coding is a good application of it, in a capacity as ersatz instructor to someone trying to learn a concept. I've not seen how advanced the code it can generate is. I haven't really used it for anything like this, but I have a colleague who is an engineer who uses it sometimes to help him through code he's stuck with. I'm a bit iffy on it myself, but OTOH I don't see a reason why not to try it when you get stuck.

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

        A Graeme_GrantG 2 Replies Last reply
        0
        • J Jeremy Falcon

          Exactly man. History repeats itself. Before the web when peeps were using Gopher and IRC for everything, only a very select few had a full grasp of where the Internet would be headed. Things evolve. Nobody uses Gopher. Nobody believes AOL _is_ the Internet anymore. :laugh:

          Jeremy Falcon

          A Offline
          A Offline
          Andre Oosthuizen
          wrote on last edited by
          #9

          I agree with both, it's just that it does not justify the time now, same as before the web, to try and secure 100% operable code immediately IMO. Will it get better, YES!, it's already better going from 3.5 to 4, will it be soon, YES, quicker than we anticipate.

          1 Reply Last reply
          0
          • A Andre Oosthuizen

            As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

            Quote:

            Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

            We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

            B Offline
            B Offline
            BillWoodruff
            wrote on last edited by
            #10

            imho: yes ... when you take into account: 1) you are using relatively new code tools/encyclopedias that are rapidly evolving. 2) you learn/adapt/master the queries/prompts that give better results. i'm using the new JetBrains ReSharper beta AI assistant (EAP 9), tuned for, of course, programming. It works in Visual Studio with no glitches. Look for an article/tip-trick from me soon on how to use it as a "secretary" which transforms bare-bones schema into boiler plate code :)

            «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

            A J 2 Replies Last reply
            0
            • H honey the codewitch

              When ChatGPT is wrong, as is often the case, it is confidently wrong, often with citations. That's why I suggest only using it on things that are immediately verifiable. Most code falls under this category, so I think coding is a good application of it, in a capacity as ersatz instructor to someone trying to learn a concept. I've not seen how advanced the code it can generate is. I haven't really used it for anything like this, but I have a colleague who is an engineer who uses it sometimes to help him through code he's stuck with. I'm a bit iffy on it myself, but OTOH I don't see a reason why not to try it when you get stuck.

              Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

              A Offline
              A Offline
              Andre Oosthuizen
              wrote on last edited by
              #11

              I agree, remember when we Google became the thing that contained all answers to the universe. We all had to learn how to search by using the right keywords and we just got better at it, same with ChatGPT.

              1 Reply Last reply
              0
              • B BillWoodruff

                imho: yes ... when you take into account: 1) you are using relatively new code tools/encyclopedias that are rapidly evolving. 2) you learn/adapt/master the queries/prompts that give better results. i'm using the new JetBrains ReSharper beta AI assistant (EAP 9), tuned for, of course, programming. It works in Visual Studio with no glitches. Look for an article/tip-trick from me soon on how to use it as a "secretary" which transforms bare-bones schema into boiler plate code :)

                «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                A Offline
                A Offline
                Andre Oosthuizen
                wrote on last edited by
                #12

                Great idea on an article Bill. Agree 100% on both your points, especially point 2.

                1 Reply Last reply
                0
                • H honey the codewitch

                  When ChatGPT is wrong, as is often the case, it is confidently wrong, often with citations. That's why I suggest only using it on things that are immediately verifiable. Most code falls under this category, so I think coding is a good application of it, in a capacity as ersatz instructor to someone trying to learn a concept. I've not seen how advanced the code it can generate is. I haven't really used it for anything like this, but I have a colleague who is an engineer who uses it sometimes to help him through code he's stuck with. I'm a bit iffy on it myself, but OTOH I don't see a reason why not to try it when you get stuck.

                  Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

                  Graeme_GrantG Offline
                  Graeme_GrantG Offline
                  Graeme_Grant
                  wrote on last edited by
                  #13

                  I find that you need to know what you are doing to handle iffy code when it happens, even when the queries that you input are of quality. Sometimes it helps, other times you spend more time trying to fix the code it generated, taking your focus away from trying to do it yourself. Where I do find it useful, is using it as a babelfish[^], ie, translating from one language to another. Not always perfect, however, it's better at this task than reliably generating code. But same conditions apply, do not trust it and if too fishy, don't get bogged down in what it generates.

                  Graeme


                  "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee

                  “I fear not the man who has practised 10,000 kicks once, but I fear the man who has practised one kick 10,000 times.” - Bruce Lee.

                  H 1 Reply Last reply
                  0
                  • Graeme_GrantG Graeme_Grant

                    I find that you need to know what you are doing to handle iffy code when it happens, even when the queries that you input are of quality. Sometimes it helps, other times you spend more time trying to fix the code it generated, taking your focus away from trying to do it yourself. Where I do find it useful, is using it as a babelfish[^], ie, translating from one language to another. Not always perfect, however, it's better at this task than reliably generating code. But same conditions apply, do not trust it and if too fishy, don't get bogged down in what it generates.

                    Graeme


                    "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #14

                    I wouldn't know firsthand. My colleague has found it helpful. As far as coding goes, he knows enough to be dangerous. He can work it out, but the result is usually a (thankfully somewhat procedurally structured at least) mess. So for him, he can kinda tell what things do even though he gets things like & and | confused sometimes. It has worked for him in the past. I don't know how often he relies on it. That's all I got.

                    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

                    Graeme_GrantG L 2 Replies Last reply
                    0
                    • H honey the codewitch

                      I wouldn't know firsthand. My colleague has found it helpful. As far as coding goes, he knows enough to be dangerous. He can work it out, but the result is usually a (thankfully somewhat procedurally structured at least) mess. So for him, he can kinda tell what things do even though he gets things like & and | confused sometimes. It has worked for him in the past. I don't know how often he relies on it. That's all I got.

                      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

                      Graeme_GrantG Offline
                      Graeme_GrantG Offline
                      Graeme_Grant
                      wrote on last edited by
                      #15

                      Hence why I said "you need to know what you are doing" which he obviously does. You don't ask a Cessna pilot to fly a Space Shuttle. ChatGPT for code is the same, dangerous in the hands of novices.

                      Graeme


                      "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee

                      “I fear not the man who has practised 10,000 kicks once, but I fear the man who has practised one kick 10,000 times.” - Bruce Lee.

                      1 Reply Last reply
                      0
                      • H honey the codewitch

                        I wouldn't know firsthand. My colleague has found it helpful. As far as coding goes, he knows enough to be dangerous. He can work it out, but the result is usually a (thankfully somewhat procedurally structured at least) mess. So for him, he can kinda tell what things do even though he gets things like & and | confused sometimes. It has worked for him in the past. I don't know how often he relies on it. That's all I got.

                        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

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

                        ChatGPT will keep the mediocre, mediocre. The less motivated will accept whatever it offers and will never attempt a better solution, or accept there is "no solution" (when in fact there is; it just needs exploring).

                        "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

                        H 1 Reply Last reply
                        0
                        • L Lost User

                          ChatGPT will keep the mediocre, mediocre. The less motivated will accept whatever it offers and will never attempt a better solution, or accept there is "no solution" (when in fact there is; it just needs exploring).

                          "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

                          H Offline
                          H Offline
                          honey the codewitch
                          wrote on last edited by
                          #17

                          I don't agree with that, as I see my colleague improving in his coding endeavors, though to be fair he doesn't use ChatGPT exclusively. He has used it to unstick himself, which is how I suggested it be employed.

                          Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

                          L 1 Reply Last reply
                          0
                          • B BillWoodruff

                            imho: yes ... when you take into account: 1) you are using relatively new code tools/encyclopedias that are rapidly evolving. 2) you learn/adapt/master the queries/prompts that give better results. i'm using the new JetBrains ReSharper beta AI assistant (EAP 9), tuned for, of course, programming. It works in Visual Studio with no glitches. Look for an article/tip-trick from me soon on how to use it as a "secretary" which transforms bare-bones schema into boiler plate code :)

                            «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                            J Offline
                            J Offline
                            jochance
                            wrote on last edited by
                            #18

                            Is that only an update away for someone lagging behind in version but with a standard ReSharper license?

                            B 1 Reply Last reply
                            0
                            • A Andre Oosthuizen

                              As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

                              Quote:

                              Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

                              We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

                              M Offline
                              M Offline
                              Matt Bond
                              wrote on last edited by
                              #19

                              For my capstone course for my master's degree, our group project is to create a mobile app that can record conversations, use speed-to-text with diarisation (distinguish different speakers), and then send the conversation to ChatGPT to get reminders, a summary, or some other function. We refer to these functions as transmogrifiers, in homage to Cavin & Hobbies. See the linked definition, which aptly also describes the results from ChatGPT. The app is suppose to help people with short-term memory loss or high short-term memory demands (like waitstaff). So I can see how using ChatGPT makes creating an app like this a lot easier because the programmer doesn't need to deal with parsing the text. That functionality is offloaded to an API that is designed to parse natural text.

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

                              B 1 Reply Last reply
                              0
                              • H honey the codewitch

                                I don't agree with that, as I see my colleague improving in his coding endeavors, though to be fair he doesn't use ChatGPT exclusively. He has used it to unstick himself, which is how I suggested it be employed.

                                Check out my IoT graphics library here: https://honeythecodewitch.com/gfx

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

                                I was referring to people who "call" themselves programmers. I got the sense your colleague is using it properly (and is not a "programmer").

                                "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

                                1 Reply Last reply
                                0
                                • J jochance

                                  Is that only an update away for someone lagging behind in version but with a standard ReSharper license?

                                  B Offline
                                  B Offline
                                  BillWoodruff
                                  wrote on last edited by
                                  #21

                                  Hi, I think you can just join the EAP program by downloading/installing the latest EAP, and that, beginning with EAP 7, the "AI Assistant beta" is available. [^] ... EAP 9: "023.2 EAP9 build 2023.2.0.9 Released: July 14, 2023 No subscription required" also see: [^] But, please, check with JetBrains/ReSharper for latest news.

                                  «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                                  1 Reply Last reply
                                  0
                                  • M Matt Bond

                                    For my capstone course for my master's degree, our group project is to create a mobile app that can record conversations, use speed-to-text with diarisation (distinguish different speakers), and then send the conversation to ChatGPT to get reminders, a summary, or some other function. We refer to these functions as transmogrifiers, in homage to Cavin & Hobbies. See the linked definition, which aptly also describes the results from ChatGPT. The app is suppose to help people with short-term memory loss or high short-term memory demands (like waitstaff). So I can see how using ChatGPT makes creating an app like this a lot easier because the programmer doesn't need to deal with parsing the text. That functionality is offloaded to an API that is designed to parse natural text.

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

                                    B Offline
                                    B Offline
                                    BillWoodruff
                                    wrote on last edited by
                                    #22

                                    Given the complexity of speech to text alone ... your project sounds ... impossible. Have you done a feasibility study ? Good luck with that ! :~ :omg:

                                    «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                                    M 1 Reply Last reply
                                    0
                                    • A Andre Oosthuizen

                                      As a quick answer, Yes and No! Their are tons of articles on it's worth, it's unworthiness etc. etc. There is a Q&A from this morning that turned out quite interesting IMO - How to take specific element from the first list , second list and those specific element add into third list[C#][^] Richard MacCutchan and Graeme_Grant posted respective solutions, both of them works as a solution. Graeme did an excercise in using ChatGPT (as he mentioned in his post, just for fun and interest sake) and it actually returned a correct answer, for a change! I then did a fun check by asking CHATGPT to check both blocks of code and show which block is - 1) The fastest generated output 2) Using the least performance 3) Is the most efficient The returned answer were that it's own generated code were the worst performer. Richard's code were Block2 and Graeme's ChatGPT code were Block1 -

                                      Quote:

                                      Block 2 will run faster and use less performance compared to Block 1. In Block 1, you are using a List to combine the elements from two lists (a1 and a2) into a single list (combinedList). The code iterates over the length of the longer list (maxLength) and checks if the current index is within the bounds of each list before adding the element to the combinedList. Finally, it uses string.Join to concatenate the elements in combinedList into a single string. In Block 2, you are using a StringBuilder (output) to build the combined string directly. The code iterates over the length of a1 and adds each element to the output. It also checks if the current index is within the bounds of a2 and adds its corresponding element. Finally, it prints the output using Console.WriteLine. Block 2 is more efficient because it eliminates the need for an additional list (combinedList). It directly builds the string using StringBuilder, which is more efficient for concatenating multiple strings compared to repeatedly appending to a List. Additionally, it does not involve the overhead of checking list bounds for every iteration, as it directly uses the lengths of a1 and a2 in the loop condition.

                                      We do from time to time make use of ChatGPT, more as an exercise than a solution and we found, as mentioned in my comment

                                      D Offline
                                      D Offline
                                      David On Life
                                      wrote on last edited by
                                      #23

                                      Short answer: it depends on what you're doing. If you can easily and completely describe what you need or break it down into pieces that it can handle, it can be a real asset. However, I don't even try to use it for lots of things where I figure telling it what I need/want to do is going to be harder than just doing it myself (or where I need to make lots of little changes in a lot of places, like refactoring). Chat GPT (and GitHub CoPilot) have written a lot of code for me. It writes new code much faster than I could and sometimes better (I once removed some 'excess code' Chat GPT added, and then had to turn around and put it back, other times it's thought of things I didn't, yet). It's also written incorrect code or poorly written code and changes styles on me at times. Typically, I can get it to correct its own work faster than I can do it myself; however, I'm always running up against the token limit. However, most of the issues I'm hitting are just growing pains. It's going to get a lot better and quickly. (I've already figured out how to make it better, but I'll probably wait for someone else to do it.) One thing that might help (for now) is to have some standard text you add to each prompt about code quality, efficiency or the style that you prefer. Or you can just ask Chat GPT to make it better. For example, in your example, did you try asking Chat GPT to rewrite the code it gave you to be more efficient? Or you might ask it if there's a way to make the other code (block 2) more efficient? Clearly it understood enough to know which was more efficient, so it probably knows how to write more efficient code, you just have to let it know that's important to you. (If you use the Chat GPT API directly you can provide standard context information, so you could plug in things you want it to consider there.)

                                      B 1 Reply Last reply
                                      0
                                      • B BillWoodruff

                                        Given the complexity of speech to text alone ... your project sounds ... impossible. Have you done a feasibility study ? Good luck with that ! :~ :omg:

                                        «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                                        M Offline
                                        M Offline
                                        Matt Bond
                                        wrote on last edited by
                                        #24

                                        Oh, we are just using AWS's speech to text. We aren't doing that ourselves. Basically, this app is a broker between several API's.

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

                                        B 1 Reply Last reply
                                        0
                                        • M Matt Bond

                                          Oh, we are just using AWS's speech to text. We aren't doing that ourselves. Basically, this app is a broker between several API's.

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

                                          B Offline
                                          B Offline
                                          BillWoodruff
                                          wrote on last edited by
                                          #25

                                          Show me proof of concept, and i'll stop laughing :omg:

                                          «The mind is not a vessel to be filled but a fire to be kindled» Plutarch

                                          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