10X Your Code with ChatGPT: How to Use it Effectively

Поділитися
Вставка
  • Опубліковано 8 лют 2023
  • A detailed look at how to properly use ChatGPT as your coding partner, including iteration and refinement of solutions. Make it do the heavy lifting as you reap the glory! Includes code, samples, analysis, and benchmarks. For my book "Secrets of the Autistic Millionaire": amzn.to/3diQILq
    Github Repo for Primes project: github.com/PlummersSoftwareLL...
    Github Repo for the ChatGPT generated code: github.com/PlummersSoftwareLL...
  • Наука та технологія

КОМЕНТАРІ • 728

  • @MrChelleas
    @MrChelleas Рік тому +375

    I've been a full-time software engineer for nearly over a year now and think I'm doing OK for myself, and yet almost every time I watch one of your videos I realize how little I actually know.

    • @Kadotus
      @Kadotus Рік тому +49

      Don't worry, I started coding in the 1990's, have a degree in software engineering and I always learn something (mostly quite a lot!) from Dave's videos. Never stop learning, there's more to know than one can ever learn.

    • @wysestone
      @wysestone Рік тому +17

      Don't feel too bad I've been in networking for about 10 years now and still have this issue just about every day when continuing in my studies... it's the blessing and curse of working in the wonderful world of IT and Computer science.

    • @gasfiltered
      @gasfiltered Рік тому +24

      Tbf to yourself, he was in your position 35 years ago. In that time he was exposed to some of the very best engineers on the planet daily, and his brain is physically wired differently. It's hardly a fair comparison. But knowing that you don't know what you don't know so very early in your career is huge and will pay you dividends for many years to come. I wish I had figured that out sooner.

    • @nmartin32950
      @nmartin32950 Рік тому +14

      While it is true that Dave could write all the code that chat GTP wrote in this video, there was a time when even Dave was learning this stuff for the first time.
      When I was going through university they taught us all the different forms of sorting algorithms and binary searches, however these things are now commonly embedded within programming language libraries.
      Chat GTP is just the next level in tooling. As Dave demonstrated you still need a logical mind to ensure the code is correct and fix bugs.

    • @everyhandletaken
      @everyhandletaken Рік тому +10

      The replies here brought a smile to my face, very good advice & encouragement!
      It really is ok to not have a solution to every single thing you face, it’s how you go about finding the solution & learning, that is the valuable part.
      I’m totally ok with not being as smart as Dave 😊

  • @Henry14arsenal2007
    @Henry14arsenal2007 Рік тому +7

    This level of prompting implies excellent knowledge of the domain and a grasp of the problems being solved. That usually is not the case for most people that only have a vague notion of a problem and/or methods to check for errors.

  • @faithinverity8523
    @faithinverity8523 Рік тому +6

    I love how it “trains” you to ask questions effectively. I think it has helped me write specs better and faster.

  • @Zaf9670
    @Zaf9670 Рік тому +15

    I think this might be a fun follow-up video now that GPT-4 is partially available. I always feel like I walk away with something new from these videos and appreciate your efforts!

  • @ScottPlude
    @ScottPlude Рік тому +9

    Am I the only one that had to replay what Dave said as the "copying and pasting from stack overflow" book was on the screen?!?!?!
    I just about died laughing and heard not one single word he said the first time I saw the book! HAHAHA
    OK, rewinding and playing one more time. Sorry, Dave. Your sense of humor is at the next level now.

  • @insanelydigitalvids
    @insanelydigitalvids Рік тому +68

    A huge amount of value in this video. Many thanks, Dave!

  • @linkinpark9812
    @linkinpark9812 Рік тому +26

    On the history part for the session, currently it's about 3,000 words (the ones you type), check their help page. After that, it may lose some of that past context (which might be fine as it keeps building on the same code you are referencing). If it's a long enough session though, and you assume it knows something from the past, it may get lost or you may be confused why it changed it's pattern. Best to restate if you are reaching far back, to "remind" it what you want it to do. Awesome video!

  • @rashadfoux6927
    @rashadfoux6927 Рік тому +163

    Haven't heard the sound of a dot matrix printer since I was a kid ._.

    • @waynesworldofsci-tech
      @waynesworldofsci-tech Рік тому +1

      They didn’t have dot matrix printers when I was a kid, or was all teletype terminals.

    • @kesierzg
      @kesierzg Рік тому +3

      They still have it in my bank

    • @ernestoditerribile
      @ernestoditerribile Рік тому +1

      @@kesierzgIn logistics you still see them a lot

    • @toby9999
      @toby9999 Рік тому +3

      ​@@waynesworldofsci-techMe too. I hooked one up to a tiny 8bit system. The teleprinter was so noisy it we shifted it to our garage.

    • @waynesworldofsci-tech
      @waynesworldofsci-tech Рік тому +1

      @@toby9999
      Oh yeah. Those things were epically loud.

  • @david_sanchez
    @david_sanchez Рік тому +23

    This was very insightful. I recently started a software company but, ironically, I am not a developer. Although I have been building my own apps since the early 1980's and am decently skilled with at least 6 languages, I have never built apps for anyone but me. ChatGPT has helped me greatly with making my code more team oriented and fault tolerant. It's definitely been much faster than the typical Google searches.
    On a side note, I thought I was the only grey bearded guy doing this. It seems all the developers I run into these days are much younger than me. And thanks a lot for the autism references. I have a son who is mid-high functioning and I too am most likely on the spectrum (I've never been tested). Thanks for existing... Dave 😁

  • @zCrabOG
    @zCrabOG Рік тому +130

    Ima first year CS student. I probably use chatGPT the most in my class. And it is an INSANE tool to learn very quickly. I have one rule though. I will not implement a block of code from GPT unless I know exactly what it does. Sometimes it can come up with solutions that are too complex for me. And it can lead to hour long discussions about the what and why.

    • @abcproduction6819
      @abcproduction6819 Рік тому +7

      You’ll not get a job for sure

    • @emmanuelameyaw9735
      @emmanuelameyaw9735 Рік тому +31

      ​@@abcproduction6819 why does it matter whether chatgpt is your professor vs some human as your professor?

    • @MandrakeDCR
      @MandrakeDCR Рік тому +30

      @@abcproduction6819 Yet another anti-ai. Just get used to it already. It's here, it's not going anywhere, and it's going to be used more and more every day. It isn't a creepy monster out to steal your job. It's a great tool that can help in a lot of ways.

    • @ahmed17167
      @ahmed17167 Рік тому +1

      Felt like reading myself. You are discussing with other for hours knowing that they also don't know the exact working or cant understand yours question.
      By the way third year SE student

    • @abcproduction6819
      @abcproduction6819 Рік тому +5

      @@MandrakeDCR it’s not about anti ai. A programmer with chatgpt can do the job of 5 engineers there by eliminating freshers or new software engineer because right now we are shortage of engineers, job will not be replaced it will reduce the number of job opportunities.

  • @tahlularose9267
    @tahlularose9267 Рік тому

    Dave, thanks for taking this on, I love the way you teach and your dry sense of humor.

  • @rilauats
    @rilauats Рік тому

    Great content! Having coded myself professionally since mid-early 1980s I certainly have my doubts on what AI can do; where its limits lie - and how we can benefit from AI in coding despite the limits. Your story here is just the greatest information I've ever seen. You beat ChatGPT, you're the bona fide coding rock-star.
    My first experience with ChatGPT was asking for info on one vendor and got a probably 100% correct description of another vendor despite the names not even close to one another. Asking for the SOLID principles was far more successful - but it felt like I was reading a slide from somebody's presentation a decade ago. The 8 years old wizard describes my experiences perfectly.
    Keep rocking, Dave!

  • @beyse101
    @beyse101 Рік тому +4

    Great video, Dave! Your explanation was really helpful in understanding the topic. I would love to see you do a follow-up video using Chat GPT 4. I'm sure it would be just as informative and insightful as this one. Thank you for sharing your knowledge with us!

  • @TravisBerthelot
    @TravisBerthelot Рік тому

    This is the best video on actually using ChatGPT for programming that I have seen. Thank you for your hard work on this.

  • @peterschutz2673
    @peterschutz2673 Рік тому +2

    This video lead me to some major productivity increases. I'm a designer by trade, but I've been delving into coding more, specifically Javascript, to help create tools to tackle niche problems. Thanks to this video and using ChatGPT because of it, I'm now creating more complex tools, faster, with better understanding. It's like having a lab partner that knows a lot about specific things, but can't always put the big picture together. I help steer it toward the goal, it gets the details right, or as close to right as it can until I explain myself better, and eventuality we arrive at a great solution.

  • @420bobby69
    @420bobby69 Рік тому +4

    discovered you the other day, just want to say this is one of the coolest channels i've stumbled upon. thanks for the informative and interesting ad-free content!

  • @RashPro
    @RashPro Рік тому +1

    Love the camera setup, thanks for the tips, I've been using chatgpt for cross reference and some more menial tasks but will certainly start to ask more specific things now :)

  • @mithrandirthegrey7644
    @mithrandirthegrey7644 Рік тому +11

    This is phenomenal. I've been using chat gpt to set up a custom linux system. I'm baffled by how much faster I am able to crank out stuff with the aid for this tool. It's 10.26 am on a Friday here and I have finished all my tasks. I'm gonna go out fishing now. I love chatGPT.

    • @ChristopherDavis
      @ChristopherDavis Рік тому

      I have been experimenting with ChatGPT and linux on a rasberry pi using docker just getting my feet wet still learning. Curious what you are having it customize?

    • @mithrandirthegrey7644
      @mithrandirthegrey7644 Рік тому +1

      @@ChristopherDavis everything. We have our own kernel modules etc. running on an IMX8 and we're updating from an ancient kernel version.

    • @GPOLICE
      @GPOLICE Місяць тому

      Why tho? What are you people doing on Linux that can't be done on windows?

  • @farab4391
    @farab4391 Рік тому +2

    this is amazing !!! I can't imagine how different my working life would've been as a systems programmer if we had this 25 years ago already. Dave was doing some specialized stuff hence the hand holding, but for the type of stuff I can think of that would've taken me at least more than a day, it spits out in 10secs and is complete. For example ... "write bash script that monitors if a file has changed and sends an email if it does" ... and ... "write bash script to extract cpu usage per hour from linux sar". This would've saved me hours, days, months of debugging syntax, typos, etc. not to mention research which methods/functions to use if I haven't done it before

  • @jeffreycordova9082
    @jeffreycordova9082 11 місяців тому +4

    Very interesting. Just the other day I had to write some pretty common extension methods, I asked ChatGPT to generate it's own for each and what it came up with was pretty good. For simple boilerplate things I'll definitely consider using it to at least stub out certain things.

  • @cliffmathew
    @cliffmathew Рік тому +8

    I came back to watch this video in full, after writing a Python based tool at work. For some portions, I consulted Chat GPT, especially around the usage of encryption and hashing, as well as the interface to the TPM module. Chat GPT was quite impressive, but because there are many libraries to deal with these things, it needed quite a bit of interaction to get it right or rather the way I wanted. It had difficulty tracking if some things were deprecated, or if the arguments to certain functions or use of certain function is appropriate in the context.
    In some C++ code it produced (for something else, not for the Python thing), it did not have the types cast correctly -- and the Visual Studio compiler kept complaining.
    My approach was to use google to read further on details of its choice of functions or imports and then make a decision if I want it to use something or not. If I found something different in Google, I also asked Chat GPT to tell me more about those things as well.
    On the whole it was very useful to me, and I am amazed at what its potential could be. At the moment I see it as a mentor who can introduce me into a topic that I am not familiar with, while letting me figure the rest of it out myself.

    • @JasonBunting
      @JasonBunting 11 місяців тому +2

      Yeah, it has a ways to go - I think only those with a trivial understanding of actual, day-to-day programming think ChatGPT is amazing at this point. There's much more to programming than writing simple little programs... Someday, though, it could be quite useful.

    • @cliffmathew
      @cliffmathew 11 місяців тому +1

      @@JasonBunting True. Yet it is a major leap from wherever we were before.

  • @di380
    @di380 Рік тому +1

    Great video Dave. I’ve been using ChatGPT to disassemble and comment my assembler code and does a great job at it.👍

  • @thromboid
    @thromboid Рік тому

    What a time to be alive! Can't wait for the next challenge video. Also I'd love to see how well it does code golf.

  • @Joe-SoftwareEngineer
    @Joe-SoftwareEngineer Рік тому +16

    "I speak Python with a C accent" love that! 😄

  • @skatterbrainz
    @skatterbrainz Рік тому

    Thank you for covering this with great examples and explanations! Very well done! I'm a new subscriber and will recommend your channel to anyone I know!

  • @xMrJanuaryx
    @xMrJanuaryx Рік тому +1

    I find it most useful on the topic of your next video. ChatGPT has optimized a lot of my code over the past few months.

  • @unrealminigolf4015
    @unrealminigolf4015 Рік тому +3

    This is fantastic Dave. Thank you.

  • @shaneferrell7852
    @shaneferrell7852 11 місяців тому

    Looking forward to seeing the next part!

  • @johnjay6370
    @johnjay6370 Рік тому +1

    I used Chat GPT to setup a timer for a pic32 that i was not familiar with using. Something like this can take a while to figure out and looking through spec sheets to setup the correct registers can take time, well chat GPT is now my best friend and I am thinking of paying for the subscription and have it as my helper.. It got some things wrong, but it got the main things correct and helped point the user in the correct direction... Great Video!!!

  • @AndersonPEM
    @AndersonPEM Рік тому +3

    I have also tested this technology for code. It's like having a junior with ADHD.
    It can help you with a lot, but you'll still need to give him directions. It's good. I like it.
    In the end of the day you still have to know how to code to infer where things can be improved or where things went bad.

  • @marcosantiago6818
    @marcosantiago6818 Рік тому

    Lovely video. I really enjoyed it. I actually, started a small little project to create a natural language interface in order to query a relatively simple database. From start to finish it took me a couple of hours, as I was experimenting and approached it as though I did not know anything about coding. As a Business Analyst and Software project manager, I found this to be very impressive. I don't see ChatGTP as threatening the coding community so much as a tool (or partner(, and maybe even a consultant of sorts. It just requires one to guide and work with the tool as though working with another collaborator.

  • @Josh-gq7uh
    @Josh-gq7uh Рік тому

    Really valuable video. Gives a lot of possibilities in maximizing the usefulness of chatGPT.

  • @lesleymunro4964
    @lesleymunro4964 Рік тому

    I just tried chatGPT for the first time yesterday. I'm not a coder, so I asked it to write a small "hello world" program which had a window and a button in it, and a counter which counts the clicks. I had it write it for linux. It chose python first, so I asked it to use C++, and it used a GTK library of some sort for the window stuff. It was amazing just watching it write the code. I tried iterating quite a few times (9 times I think), and it would sometimes jump into different languages, or drop stuff it had did right previously. I think it was more my mistakes in feeding in the correct prompts for what I wanted.
    I think to use it, you need to be clear with it what languages you want to use, and in any corrections you want it to use the code previous in the conversation. I found it an incredibly fascinating tool, and even if it doesn't get you all the way there, it certainly gives you enough code that you can tweak to get it to do what you want. It's going to be game changing as it learns more data.

  • @ai15208
    @ai15208 8 місяців тому

    its amazing how i have been using windows for most of my life and never heard of you or this channel, 1 year of using linux and the youtube algo shows me this.....I think you might enjoy that fact, as a low performing engineer with concentration issues , i find your videos really calming even though i dont understand most of them =).

  • @vcv6560
    @vcv6560 Рік тому +2

    This was much more valuable than the problems I tried, 68K assembly. Old enough I still remember, and easy to optimize. Thanks for this video.

    • @toby9999
      @toby9999 Рік тому +1

      The 68K CPU was nice to program

    • @wesleyelsberry5433
      @wesleyelsberry5433 Рік тому

      @@toby9999 I did just enough iAPX-86 assembly to come to loathe it. The 68K's assembly language looked to me quite similar to IBM 370 Assembly, and as you say, quite pleasant to work with. The story I've heard was that the IBM PC got built with the 8088 because the engineers tasked with making the prototype were given a very compressed development schedule, and while they liked the looks of the 68008's specification, they were already familiar with building Intel 8085 systems, and the 8088 used the same support chips.

  • @landrec2
    @landrec2 Рік тому

    Oh Ive been waiting for this! Thanks Dave!

  • @wisteela
    @wisteela Рік тому +2

    It really is brilliant. I love the fact it can even do ancient languages like COBOL and Fortran.

  • @Arcadenut1
    @Arcadenut1 Рік тому +5

    It's a very useful tool, but like all tools you need to know its limitations and how to use it correctly, which this video illustrates very well. I can see this supplementing things like StackOverflow, but it can't replace it because that's where part of it's knowledge comes from.

  • @UlfAndersson-zf2yk
    @UlfAndersson-zf2yk Рік тому

    Dave, thanks again! And please tell us more, we need this!

  • @jameskeel
    @jameskeel Рік тому

    Thank you for sharing as I have hacked for many years, but I still learn more today.

  • @tristan4777
    @tristan4777 Рік тому

    Thanks Dave. It's great to see some useful examples of what can be done with AI (ChatGPT in particular).

  • @slimyelow
    @slimyelow 9 годин тому +1

    She PT is my best friend at work. Last week she did all my regex work and the week before all my linux and docker work. This week it's on to xsl, xml, vuetify and vue 3. My TL likes me and offered a raise. - what more can I say...

  • @jsmythib
    @jsmythib 3 місяці тому

    I have been a hobby programmer since 1982...I have been using gpt4 for assistance for a few months now. The capabilities it does have leave me in awe. It has helped me break barriers- wickedly. :) Its my guess there was a massive amount of information sampled in the fields..Which seems logical considering the resources they could openly used. So much fun :)

  • @konberner170
    @konberner170 Рік тому

    Once again, Dave puts the "awe" into awesome.

  • @pferdebert
    @pferdebert Рік тому +17

    3:50: you can do the same in C++
    for (auto [r, num] : map) { ... }
    or
    for (const auto& [r, num] : map) { ... }

    • @DavesGarage
      @DavesGarage  Рік тому +7

      Very cool, I've never tried that!

    • @cheez3d
      @cheez3d Рік тому +1

      @@DavesGarage They're called structured bindings.

    • @matthewyoung2554
      @matthewyoung2554 Рік тому +2

      Requires C++17

  • @SuperFighter94
    @SuperFighter94 Рік тому

    From my uses, i have come to similar conclusions to Dave here. I find it also very helpful to give it code that is poorly commented and tell it to tell me what it does or add comments to it. Context is King with chatGPT so making sure you ask narrow, well define questions will give you better results. Too broad or without context will give you something, but it might be a wild goose chase for hours or even days.

  • @DarinM1967
    @DarinM1967 Рік тому

    Software like ChatGPT is bringing all of us closer and closer to the day when we describe our programs in What we want, instead of always in How to do it, in any language that fits the job best.

  • @tompov227
    @tompov227 Рік тому

    Pretty cool seeing someone else use the Warp terminal !

  • @drewwilson8756
    @drewwilson8756 Рік тому +3

    Thanks for the lesson Dave! Looking forward to seeing ChatGPT check on code. I would imagine that option has more value.

    • @SaintSaint
      @SaintSaint Рік тому

      Yes! I often use it to insert comments in my code. Then I check to make sure the comments are correct. Or I'll use it to even write requirements of some scripts that I had to hammer out. It's a great way to answer my boss when he says "what all do your scripts do?" or "Why do we need your scripts to fix our vendor's output?" Chat GPT misses a few things. I miss a few things that I wanted to talk about. But having a second set of eyes on my code is where ChatGPT really shines.

  • @DylansIlliterateMind
    @DylansIlliterateMind Рік тому +2

    Love the approach you have for your videos, it's very inspiring. It would be super cool if you could at some stage do a few videos about using the VS code plugin for chatgpt (Open AI CODEX). I've been trying it out but it still feels quite clunky.

  • @mrfoodarama
    @mrfoodarama Рік тому +1

    Love that Dot Matrix sound!

  • @DodaGarcia
    @DodaGarcia Рік тому

    How did I not know about this channel? It's fantastic!

  • @alonzosmith6189
    @alonzosmith6189 Рік тому

    I am new to writing scripts. I was pretty good at using dos batch files, still use robocopy to backup my laptop and desktop. I asked Chatgpt for help with powershell, just received commands with description to use. Will continue to use Chatgpt for examples.

  • @jpandrews2791
    @jpandrews2791 Рік тому

    Used it to write a php script to cycle through every pdf file in a directory, execute a utility to convert them to text files, find and extract tables of data, combine the data and insert into a sql db. Yes, required a fair few iterations but it got there in the end. Also used it to help write clauses for a contract; put in your attempt and ask chatgpt to improve on it and often it does. It seems to know the date but not the time. I asked it why it knew the date and not the time and got into an argument about that. Asked it whether it would reveal some information to someone if knowing that information would cause that person harm; got into another argument about that. Chatgpt is the first version and I think it's remarkable - as long as you carefully curate both your input and it's output.

  • @wilhallman2890
    @wilhallman2890 Рік тому +1

    Been coding for 30 years and ChatGPT is a MAJOR game changer.

  • @nektariosmusic
    @nektariosmusic 11 місяців тому

    Wow, this was jaw dropping! I couldn't believe my eyes...

  • @jim4859
    @jim4859 Рік тому +1

    Very timely. I've just started exploring Chat-GPT

    • @ChrisM541
      @ChrisM541 Рік тому

      You DO know it's banned in stackoverflow etc !! - do you know why?!!

  • @robtathome
    @robtathome Рік тому

    Dave - incorporating different processors with multi-threading, you must be a monster programmer!

  • @JacobCanote
    @JacobCanote Рік тому +1

    I am with ya. It's fun to see what it comes up with it.

  • @Will-kt5jk
    @Will-kt5jk Рік тому +1

    I can see some benefits in it highlighting methods/approaches you haven’t thought of & using it as a sounding board by coaching it through writing code in a “teaching is learning” sort of way.
    But for the most part, so far my experiments have lead me more to thinking it would still be quicker to get the product by hand-coding & using stack overflow/google.
    I might miss some additional learning along the way, but get to the result faster.
    I guess it’s a bit like pair-programming in that way except only one human is learning through the process, rather than 2 (despite others’ reports of ChatGPT remembering across different chats, I’ve not found that to be the case - attention seems restricted to within 1 chat session, with the exception that disliking a result in one chat can seemingly add a new guardrail for new chats

  • @ryanwalker4660
    @ryanwalker4660 Рік тому +1

    Nice video, I enjoy ChatGPT, it's not perfect but it works great for getting an example and incorporating it into your own work.

  • @kristapskarnitis9613
    @kristapskarnitis9613 Рік тому +1

    What a great video!
    Im sad I only now stumbled on to this channel
    As a self taught mainly web stack developer it really helps to hear the thought process of what I would call a real programmer :D
    Thank you!

  • @mylittleparody2277
    @mylittleparody2277 Рік тому +1

    An awesome video!
    Thank you so much for sharing your knowledge with us.

  • @dvongrad
    @dvongrad Рік тому +3

    The largest number that can be converted to Roman numerals with common letters (ie: not the use of bar-M, etc.) is 3999 = MMMCMXCIX, although the longest Roman numeral string does indeed come from converting 3888.

  • @tedkrapf1302
    @tedkrapf1302 Рік тому

    Thanks Dave! Great demo :)

  • @TheHelvetican
    @TheHelvetican Рік тому

    I'm loving it. More please.

  • @generovinsky
    @generovinsky Рік тому

    Thanks for the great advice and info Dave ;)

  • @Nusremmus
    @Nusremmus Рік тому +2

    I knew this was coming. I can see how it can up your coding game. Definitely going to impact StackOverflow. I think it also proves that it is nowhere near sentient. I can't wait to play around with this. Thanks for another awesome video!!

    • @Atheist7
      @Atheist7 Рік тому +1

      Better start using it now, they're going to charge for it starting on Mar. 13.

    • @Nusremmus
      @Nusremmus Рік тому

      @@Atheist7 I did not know that. Any idea what estimate pricing might be?

  • @CielMC
    @CielMC Рік тому +2

    This showcases the characteristics of ChatGPT perfectly, it's just like Copilot, it can help you do a lot, especially the repetitive parts, but it's not "coming for our jobs", programming isn't just about writing code, and it can make a lot of mistakes that you need to see and fix yourself one way or another anyway.

    • @cliffmathew
      @cliffmathew Рік тому

      Don't forget this algorithm is meant to learn, so I won't be surprised if it improves to a point where it can directly spit out optimized machine code. Programming languages will be irrelevant if humans are not involved.

  • @bungalowjuice7225
    @bungalowjuice7225 Рік тому +1

    I have never programmed before, and I pretty much only know how to turn on the computer. I managed to make a working tictactoe game with ChatGPT.
    In just a couple of minutes. It's my "hello world" moment.
    I can learn so much from this AI.

  • @norcal6181
    @norcal6181 Рік тому

    I asked it basically the same question (worded slightly differently about int to roman conversion) and in Python it gave a solution using an algorithm that is closer to the C++ solution it gave here.

  • @kwazar6725
    @kwazar6725 Рік тому +1

    Real nice dave. Liked the fx80 and impressed chatgpt does the multithreaded and gpu translation. Pity the context is not permanently persisted..

    • @nkronert
      @nkronert Рік тому

      Are you sure it was an fx80? I thought so too, but I guess there were many more models of dot matrix printers around at the time. For sure it didn't sound like a Star-NL10 🙂

  • @D3M3NT3Dstrang3r
    @D3M3NT3Dstrang3r Рік тому +12

    I have been using it to write a basic square wave generator that displays the current frequency on the oled display on an esp32 board. It definitely can write the code but it does need specifics to get things right. Even then you will be cleaning or changing some code here and there to meet your requirements. However as a novice coder I have now written code that I otherwise would not have currently been able to alone.

    • @SaintSaint
      @SaintSaint Рік тому +1

      yeah. I've found that it's deceptive. Kind of like getting your answers from stack overflow. There's a lot of "Yes that's right... but not in my case" or situations where the code works but only coincidentally and it's not germane to the goal. This is a fault of the operator(me)... but it's also a fault of the inability to penetrate the spapiential circle of understanding.

  • @tomski2671
    @tomski2671 11 місяців тому

    Thank You for your work on 2000 and XP, the pinnacle of Microsoft's operating systems

  • @tordjarv3802
    @tordjarv3802 Рік тому +9

    I did almost the same but for a Sudoku solver in Rust (a language I’m currently learning). It worked well except when I tried to get it to make a GUI for the app, but that wasn’t ChatGPT’s fault since the GUI library it tried to use had update a lot since ChatGPT was trained. I think that these technologies will augment programmers rather than replace (which most people seems to think), just like compilers augmented programmers in the late 50:ies and early 60:ies.

    • @nmartin32950
      @nmartin32950 Рік тому

      Augment, yes indeed. Just like visual studio 2022 create a complete working app as a starting place for a new solution. Turbo C wouldn't even write a main() template for me back in the day, hahaha.

    • @nickwallette6201
      @nickwallette6201 Рік тому +1

      It's reasonable to think that... for now. But, the key assumption here is that the AI's abilities are constant.
      Think of it this way: Today, it can take a simple request, and write a small module of code to accomplish that. (Which, alone, is extraordinary. Like, breathtaking. If this didn't stop you in your tracks the first time you saw it, you're not comprehending just how amazing that actually is.)
      It is doing this based on information it has consumed from humans, in the often vague and imperfect way that we communicate. If you ask AI to describe the code it wrote, it's often impeccable documentation. Well written, clear, concise but thorough, and accurate. Now imagine what happens when you use _that_ documentation as an input to AI, vs. the man-pages and HTML docs that we've cobbled together as an afterthought.
      Then, ask it to develop the code that makes up the compilers, interpreters, and libraries that it's using to support the code it writes for you. So now, it not only has better source documentation, but might potentially better understand the source code as well, giving it a whole other layer of insight.
      After a while, we don't even necessarily care about the libs and compilers and their documentation, since the AI has created them, and the AI uses them to produce code for us. At that point, why ask it to produce code? Why not just ask it to produce a binary? Imagine the efficiency of what it could come up with, if it didn't need to be optimized for human understanding.
      While all of this is happening, the scale of the AI's intelligence, itself, is increasing in sophistication.
      In that light, it's not hard to imagine AI being able to craft much larger projects in the future. With today's AI engines? No. But, as AI gets better at writing code, it can potentially start being the tool that's used to create itself. (Not necessarily in the SkyNet sense, but in the "better tools to make better tools" sense.) This will only accelerate the scale of its abilities, as less time is wasted implementing ideas.
      So. It's not hard to imagine that in a few short years, we could see simple AI-generated applications. Maybe text editors or website generators, or who knows what. It'll probably be a little while before we ask Bing to create a Microsoft Office clone, but maybe not as long as you would think. It just has to get over the hurdle of breaking a large problem into a series of small ones, and then keeping track of how they all fit together. Eventually, it's going to be infinitely better at that than we are.

  • @repairstudio4940
    @repairstudio4940 Рік тому

    I absolutely love your channel liked and subbed of course!

  • @microcolonel
    @microcolonel Рік тому

    It took me about 20 messages to get ChatGPT to correct a decimal number parsing subroutine in RISC-V assembly, but it was very good fun. It struggled with accidentally shadowing registers, refusing to shadow them when it didn't matter, and assuming that there is an instruction to multiply with an immediate in RISC-V, then that it would be worth emitting a constant pool to divide by ten rather than using shift and subtraction, then struggling to accumulate in the correct register, then zeroing the pointer argument before putting it into a temporary register...
    ...but still really impressive, and does structural programs much better than assembly.

    • @microcolonel
      @microcolonel Рік тому

      I'm interested to see how systems like this can help with early rewriting of handmade SIMD kernels into vector code for the RISC-V V extension; maybe you give it a generic symbolic program that has the same behavior, then the existing SIMD kernels (on whatever platforms they're available for) and then ask for the vectors. I think ChatGPT's current training set has too little RVV code and discussion thereof to do this right now, but a later set might do it quite well.

  • @ianwarren958
    @ianwarren958 Рік тому +2

    Awesome.
    May have to have a play with chat GPT and see how it is writing something I’m more familiar with like MS SQL queries, stored procedures SSIS ETL etc that I haven’t done for a few years!
    This could be fun!

    • @wesleyelsberry5433
      @wesleyelsberry5433 Рік тому

      I have various projects with SQL in stuff like T-SQL from SQL Server, but would like to shift to Postgresql. ChatGPt seems to do a creditable job in translating between dialects of SQL. Lately, I've just been asking for translations to round out SQL Server, Postgresql, MySQL, and SQLite, so I can go almost any which way.

  • @bakedbeings
    @bakedbeings 9 місяців тому

    Having it write the make/cmake scripts would be a big help ❤

  • @chuxxsss
    @chuxxsss Рік тому

    Love the tape drive, with the old rabbit.

  • @rolandgerard6064
    @rolandgerard6064 Рік тому

    This is a very good video and many thanks to share files as well.

  • @bit-tuber8126
    @bit-tuber8126 Рік тому

    Going to be playing with this for sure

  • @AndersNielsen
    @AndersNielsen Рік тому +1

    I've used it multiple times to optimize code and most of the time, i get better knowledge on new ways to do things.

    • @ChrisM541
      @ChrisM541 Рік тому

      Lol, You DO know it's banned in the main programming forums such as stackoverflow etc !! - do you know why?!! clue: massive bull + shitter

  • @LAWRENCESYSTEMS
    @LAWRENCESYSTEMS Рік тому

    Excellent video

  • @wagsman9999
    @wagsman9999 Рік тому +1

    This is all pretty amazing

  • @DMS20231
    @DMS20231 10 місяців тому

    Long story long I was using the Arduino IDE to write some code for an ESP32 at work. Compilation was failing silently with absolutely no indication in the output window as to what was wrong. The Arduino IDE is one of the most abysmal development environments ever created.
    Anyway, I remarked to a coworker that it had essentially thrown up the middle finger at me, which inspired me…
    I went to ChatGPT (4) and asked it to write me a Visual Studio extension in C# that would print ASCII art to the output window on a failed compilation. My intention was to paste in a middle finger ASCII graphic.
    It did it. About 95% working. I had to tweak some things because of deprecated libraries and stuff but it got me almost all of the way there. I was floored.
    This thing isn’t going to replace developers this year or next, but it’s an incredible tool for getting you on (hopefully) the right track, particularly in an area where you don’t have any experience (Visual Studio extensions in this case). Very cool.

  • @sjoervanderploeg4340
    @sjoervanderploeg4340 Рік тому

    I used ChatGPT for so many different things, from programming to playing science fiction RPG's to come up with story ideas :D

  • @HikikomoriDev
    @HikikomoriDev Рік тому

    Excellent tool for learning code and retaining it.

    • @ChrisM541
      @ChrisM541 Рік тому

      You DO know it's banned in stackoverflow etc !! - do you know why?!!

  • @TheGadusi
    @TheGadusi Рік тому

    brilliant as always

  • @J77199
    @J77199 8 місяців тому

    Dang and this was done with GPT3 version 4 is way way way better. Thanks Dave great stuff

  • @stevescheffler4219
    @stevescheffler4219 Рік тому

    thank you for this information.

  • @jlouis9686
    @jlouis9686 Рік тому

    Great proof of concept.

  • @btd6vids
    @btd6vids Рік тому +16

    Hey Dave, the “if __name__ == main” is just Python’s equivalent of a main method. Python files are just scripts that will run any code that isn’t inside a function definition or similar when you run them, so that if statement means if this file is the file you chose to run, execute this code. If you don’t have that, it will still run, but it would also run if you included that file in some other code, which could be unintended.

  • @GodSpeaksInMath
    @GodSpeaksInMath Рік тому

    Hey I remember that shirt... vintage 90s.. i had a few...great vids dave

  • @lazerusmfh
    @lazerusmfh Рік тому

    This was awesome thanks!!

  • @rufio.tf2
    @rufio.tf2 10 місяців тому

    Thank you for making this! The old printer sounds during ChatGPT's output writing has me laughing out loud.

  • @matt_kelly
    @matt_kelly 11 місяців тому

    I had ChatGPT generate a simple client class for handling websocket communication, which it did. Each time I asked for a refinement (introduce a variable for the address, add error handling for the read, stuff like that) I would get different results. For example, when I asked it to introduce a variable for the address it added a private var and set it in the constructor. When I tried to refine the code by adding some error handling, it moved the address variable to the "send message" function signature instead of the constructor. I asked it to put it back and it did.
    Basically this told me that ChatGPT will be useful for things like unit tests (which I did prompt for and it wrote them) and boilerplate/simple code, but it can't write complex systems just yet. Perhaps it may in the future, but for now it will be a great tool for simpler functionality. Not that Dave's example is simple, I couldn't write it, but I couldn't write a simple game in Unreal, for example, all with ChatGPT.

    • @matt_kelly
      @matt_kelly 10 місяців тому

      @@ghost_mall I agree, it has helped me with a few functions that I just couldn't think of how to solve in my head. I asked ChatGPT and it spat out an obvious answer.

  • @midtskogen
    @midtskogen Рік тому +38

    I agree that this will become an important tool. As for use in big companies, maybe wait until the copyright lawyers have fought it through and the legal dust has settled.
    It's impressive that the AI can be guided to a working solution, but I don't think I'd have the patience. I would give it a few attempts, then correct the code myself. This will be a great tool for getting started with things. When writing code myself I find it efficient to write an outline which I might know will not work, perhaps not even compile. Then I will go on fixing it. This AI can do the first step and be a very time saving tool.
    Back in the 80's there was much talk about fifth generation programming languages and programming languages of the time were only to be considered temporary tools towards such languages. The programmer should simply describe a problem, not the algorithm, and the computer would solve it. Since then many things have been marketed as fifth generation languages and been far from it, but maybe now we're beginning to see what the real thing looks like.

    • @ChrisM541
      @ChrisM541 Рік тому

      It's NOT 'AI' - a term that's extremely abused...everywhere today. You know damn well there's ZERO Artificial Intelligence today. Why? if there was, we wouldn't be here. Today's ai is nothing more that an extremely poor pattern matcher.

    • @yourwallet4219
      @yourwallet4219 Рік тому +4

      Yes, I think it will be very strong for creating boilerplates and perhaps the inevitable menial tasks that come with the start of every new project. I still think it will always be good to know how to write from scratch, but it definitely does, at the least, work as an extra set of eyes and can add an extra angle to one's perspective.
      I just tried an AI art generator for the first time the other day, and I was blown away with the creativity, detail, and understanding of the workings of the real/practical world, but maybe that's just through association, rather than actual full understanding of what it is designing.

    • @ChrisM541
      @ChrisM541 Рік тому

      @@yourwallet4219 " I still think it will always be good to know how to write from scratch"
      --> What a shocking, self-damning statement. If this is the general/mass 'level' of programming today, Hell mend us.

    • @yourwallet4219
      @yourwallet4219 Рік тому +3

      @@ChrisM541 Not every statement has to be profound. Go kick rocks.

    • @codytownsend3259
      @codytownsend3259 Рік тому

      Obviously it doesn't understand anything...it's a computer. Programmed to do something.

  • @PizzaManNick
    @PizzaManNick Рік тому

    Dave you're the best!

  • @UrknetLabradories
    @UrknetLabradories 8 місяців тому

    I would love to see a follow up on this now that things like gpt-engineer are available