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

2023 ж. 8 Ақп.
323 286 Рет қаралды

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...

Пікірлер
  • 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.

    @MrChelleas@MrChelleas Жыл бұрын
    • 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.

      @Kadotus@Kadotus Жыл бұрын
    • 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.

      @wysestone@wysestone Жыл бұрын
    • 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.

      @gasfiltered@gasfiltered Жыл бұрын
    • 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.

      @nmartin32950@nmartin32950 Жыл бұрын
    • 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 😊

      @everyhandletaken@everyhandletaken Жыл бұрын
  • "I speak Python with a C accent" love that! 😄

    @Joe-SoftwareEngineer@Joe-SoftwareEngineer Жыл бұрын
  • I love how it “trains” you to ask questions effectively. I think it has helped me write specs better and faster.

    @faithinverity8523@faithinverity8523 Жыл бұрын
  • A huge amount of value in this video. Many thanks, Dave!

    @insanelydigitalvids@insanelydigitalvids Жыл бұрын
  • 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.

    @ScottPlude@ScottPlude Жыл бұрын
  • 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.

    @Henry14arsenal2007@Henry14arsenal2007 Жыл бұрын
  • 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!

    @Zaf9670@Zaf9670 Жыл бұрын
  • Haven't heard the sound of a dot matrix printer since I was a kid ._.

    @rashadfoux6927@rashadfoux6927 Жыл бұрын
    • They didn’t have dot matrix printers when I was a kid, or was all teletype terminals.

      @waynesworldofsci-tech@waynesworldofsci-tech Жыл бұрын
    • They still have it in my bank

      @kesierzg@kesierzg Жыл бұрын
    • @@kesierzgIn logistics you still see them a lot

      @ernestoditerribile@ernestoditerribile Жыл бұрын
    • ​@@waynesworldofsci-techMe too. I hooked one up to a tiny 8bit system. The teleprinter was so noisy it we shifted it to our garage.

      @toby9999@toby9999 Жыл бұрын
    • @@toby9999 Oh yeah. Those things were epically loud.

      @waynesworldofsci-tech@waynesworldofsci-tech Жыл бұрын
  • 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.

    @zCrabOG@zCrabOG Жыл бұрын
    • You’ll not get a job for sure

      @abcproduction6819@abcproduction6819 Жыл бұрын
    • ​@@abcproduction6819 why does it matter whether chatgpt is your professor vs some human as your professor?

      @emmanuelameyaw9735@emmanuelameyaw9735 Жыл бұрын
    • @@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.

      @MandrakeDCR@MandrakeDCR Жыл бұрын
    • 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

      @ahmed17167@ahmed17167 Жыл бұрын
    • @@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.

      @abcproduction6819@abcproduction6819 Жыл бұрын
  • 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!

    @linkinpark9812@linkinpark9812 Жыл бұрын
  • 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!

    @420bobby69@420bobby69 Жыл бұрын
    • Awesome, thank you!

      @DavesGarage@DavesGarage Жыл бұрын
  • 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 :)

    @RashPro@RashPro Жыл бұрын
  • Dave, thanks for taking this on, I love the way you teach and your dry sense of humor.

    @tahlularose9267@tahlularose9267 Жыл бұрын
  • 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!

    @beyse101@beyse101 Жыл бұрын
  • This is fantastic Dave. Thank you.

    @unrealminigolf4015@unrealminigolf4015 Жыл бұрын
  • 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.

    @peterschutz2673@peterschutz2673 Жыл бұрын
  • 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.

    @mithrandirthegrey7644@mithrandirthegrey7644 Жыл бұрын
    • 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?

      @ChristopherDavis@ChristopherDavis Жыл бұрын
    • @@ChristopherDavis everything. We have our own kernel modules etc. running on an IMX8 and we're updating from an ancient kernel version.

      @mithrandirthegrey7644@mithrandirthegrey7644 Жыл бұрын
    • Why tho? What are you people doing on Linux that can't be done on windows?

      @GPOLICE@GPOLICE29 күн бұрын
  • 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.

    @thromboid@thromboid Жыл бұрын
  • 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 😁

    @david_sanchez@david_sanchez Жыл бұрын
  • 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!

    @rilauats@rilauats Жыл бұрын
  • 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!

    @skatterbrainz@skatterbrainz Жыл бұрын
  • 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.

    @jeffreycordova9082@jeffreycordova908211 ай бұрын
  • Great video Dave. I’ve been using ChatGPT to disassemble and comment my assembler code and does a great job at it.👍

    @di380@di380 Жыл бұрын
  • Oh Ive been waiting for this! Thanks Dave!

    @landrec2@landrec2 Жыл бұрын
  • This is the best video on actually using ChatGPT for programming that I have seen. Thank you for your hard work on this.

    @TravisBerthelot@TravisBerthelot Жыл бұрын
  • 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.

    @xMrJanuaryx@xMrJanuaryx Жыл бұрын
  • Looking forward to seeing the next part!

    @shaneferrell7852@shaneferrell785210 ай бұрын
  • 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.

    @vcv6560@vcv6560 Жыл бұрын
    • The 68K CPU was nice to program

      @toby9999@toby9999 Жыл бұрын
    • @@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.

      @wesleyelsberry5433@wesleyelsberry5433 Жыл бұрын
  • 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

    @farab4391@farab4391 Жыл бұрын
  • It really is brilliant. I love the fact it can even do ancient languages like COBOL and Fortran.

    @wisteela@wisteela Жыл бұрын
  • 3:50: you can do the same in C++ for (auto [r, num] : map) { ... } or for (const auto& [r, num] : map) { ... }

    @pferdebert@pferdebert Жыл бұрын
    • Very cool, I've never tried that!

      @DavesGarage@DavesGarage Жыл бұрын
    • @@DavesGarage They're called structured bindings.

      @cheez3d@cheez3d Жыл бұрын
    • Requires C++17

      @matthewyoung2554@matthewyoung2554 Жыл бұрын
  • 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.

    @Arcadenut1@Arcadenut1 Жыл бұрын
  • 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.

    @cliffmathew@cliffmathew Жыл бұрын
    • 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.

      @JasonBunting@JasonBunting11 ай бұрын
    • @@JasonBunting True. Yet it is a major leap from wherever we were before.

      @cliffmathew@cliffmathew11 ай бұрын
  • Really valuable video. Gives a lot of possibilities in maximizing the usefulness of chatGPT.

    @Josh-gq7uh@Josh-gq7uh Жыл бұрын
  • 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.

    @marcosantiago6818@marcosantiago6818 Жыл бұрын
  • Once again, Dave puts the "awe" into awesome.

    @konberner170@konberner170 Жыл бұрын
  • Dave, thanks again! And please tell us more, we need this!

    @UlfAndersson-zf2yk@UlfAndersson-zf2yk Жыл бұрын
  • 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.

    @lesleymunro4964@lesleymunro4964 Жыл бұрын
  • Thanks Dave. It's great to see some useful examples of what can be done with AI (ChatGPT in particular).

    @tristan4777@tristan4777 Жыл бұрын
  • 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.

    @AndersonPEM@AndersonPEM Жыл бұрын
  • Thanks for the lesson Dave! Looking forward to seeing ChatGPT check on code. I would imagine that option has more value.

    @drewwilson8756@drewwilson8756 Жыл бұрын
    • 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.

      @SaintSaint@SaintSaint Жыл бұрын
  • Pretty cool seeing someone else use the Warp terminal !

    @tompov227@tompov227 Жыл бұрын
  • 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!!!

    @johnjay6370@johnjay6370 Жыл бұрын
  • An awesome video! Thank you so much for sharing your knowledge with us.

    @mylittleparody2277@mylittleparody2277 Жыл бұрын
    • Glad it was helpful!

      @DavesGarage@DavesGarage Жыл бұрын
  • Thanks Dave! Great demo :)

    @tedkrapf1302@tedkrapf1302 Жыл бұрын
  • 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.

    @DylansIlliterateMind@DylansIlliterateMind Жыл бұрын
  • How did I not know about this channel? It's fantastic!

    @DodaGarcia@DodaGarcia Жыл бұрын
  • Very timely. I've just started exploring Chat-GPT

    @jim4859@jim4859 Жыл бұрын
    • You DO know it's banned in stackoverflow etc !! - do you know why?!!

      @ChrisM541@ChrisM541 Жыл бұрын
  • 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

    @Will-kt5jk@Will-kt5jk Жыл бұрын
  • Thanks for the great advice and info Dave ;)

    @generovinsky@generovinsky Жыл бұрын
  • I'm loving it. More please.

    @TheHelvetican@TheHelvetican Жыл бұрын
  • 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.

    @DarinM1967@DarinM1967 Жыл бұрын
  • Been coding for 30 years and ChatGPT is a MAJOR game changer.

    @wilhallman2890@wilhallman2890 Жыл бұрын
  • 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!!

    @Nusremmus@Nusremmus Жыл бұрын
    • Better start using it now, they're going to charge for it starting on Mar. 13.

      @Atheist7@Atheist7 Жыл бұрын
    • @@Atheist7 I did not know that. Any idea what estimate pricing might be?

      @Nusremmus@Nusremmus Жыл бұрын
  • 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.

    @dvongrad@dvongrad Жыл бұрын
  • I absolutely love your channel liked and subbed of course!

    @repairstudio4940@repairstudio4940 Жыл бұрын
  • Love that Dot Matrix sound!

    @mrfoodarama@mrfoodarama Жыл бұрын
  • Nice video, I enjoy ChatGPT, it's not perfect but it works great for getting an example and incorporating it into your own work.

    @ryanwalker4660@ryanwalker4660 Жыл бұрын
  • 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.

    @D3M3NT3Dstrang3r@D3M3NT3Dstrang3r Жыл бұрын
    • 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.

      @SaintSaint@SaintSaint Жыл бұрын
  • 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.

    @jpandrews2791@jpandrews2791 Жыл бұрын
  • 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 :)

    @jsmythib@jsmythib3 ай бұрын
  • 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.

    @alonzosmith6189@alonzosmith6189 Жыл бұрын
  • 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.

    @SuperFighter94@SuperFighter94 Жыл бұрын
  • Dave - incorporating different processors with multi-threading, you must be a monster programmer!

    @robtathome@robtathome11 ай бұрын
  • Thank you for sharing as I have hacked for many years, but I still learn more today.

    @jameskeel@jameskeel Жыл бұрын
  • 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.

    @bungalowjuice7225@bungalowjuice7225 Жыл бұрын
  • Real nice dave. Liked the fx80 and impressed chatgpt does the multithreaded and gpu translation. Pity the context is not permanently persisted..

    @kwazar6725@kwazar6725 Жыл бұрын
    • 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 🙂

      @nkronert@nkronert Жыл бұрын
  • I am with ya. It's fun to see what it comes up with it.

    @JacobCanote@JacobCanote Жыл бұрын
  • Well this is the sort of thing I like to see about 'how chat GPT will replace programmers'. Clearly as it stands now it will not. I always tell people that programming isn't about writing code it's about solving problems using computers. And you're not going to see non-programmers spitting out real solutions using this tool. Excellent example of how to work with the tools available, Dave!

    @jamesclark2663@jamesclark2663 Жыл бұрын
    • " 'how chat GPT will replace programmers'. Clearly as it stands now it will not. " And it never will. The simple truth is that AI can't come up with new solutions, it can literally only look at what it has seen before and find the "best match" to the input, *IF* it understand what the input means. And understanding what the input means is where most of the programmer's problems are even if you are human and are a million times better at undertstanding text than any AI will ever be. If you can use google, and any modern IDE, then ChatGPT really is just a code generator that makes stuff you can't use without fixing it first. It's nice that ChatGPT can write some code for you, but it's useless if you don't understand what the code does. It's like getting an external programmer to write some code without giving you documentation. But you can make it do the boring stuff? Yes, and if you have any modern IDE there are shortcurts that do all that for you, but then while keeping your currentcode in mind (something AI can't do) TL;DR: just learn how to use the tools that you have, it's faster, gives you better code and makes your life a lot easier.

      @vinny142@vinny142 Жыл бұрын
    • Even if it was perfect, you'd still have to exactly specify what you want and verify it works. In that case it would simply be a higher level language, still needing programmers.

      @Rakkoonn@Rakkoonn Жыл бұрын
    • @@Rakkoonn Exactly

      @jamesclark2663@jamesclark2663 Жыл бұрын
  • 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!

    @ianwarren958@ianwarren958 Жыл бұрын
    • 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.

      @wesleyelsberry5433@wesleyelsberry5433 Жыл бұрын
  • 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.

    @tordjarv3802@tordjarv3802 Жыл бұрын
    • 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.

      @nmartin32950@nmartin32950 Жыл бұрын
    • 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.

      @nickwallette6201@nickwallette6201 Жыл бұрын
  • 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!

    @kristapskarnitis9613@kristapskarnitis9613 Жыл бұрын
  • 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.

    @CielMC@CielMC Жыл бұрын
    • 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.

      @cliffmathew@cliffmathew Жыл бұрын
  • Wow, this was jaw dropping! I couldn't believe my eyes...

    @nektariosmusic@nektariosmusic10 ай бұрын
  • 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.

      @microcolonel@microcolonel Жыл бұрын
  • those subtle jokes and dot matrix printer effects! lol thanks Dave

    @johnlow3894@johnlow3894 Жыл бұрын
  • I've used it multiple times to optimize code and most of the time, i get better knowledge on new ways to do things.

    @AndersNielsen@AndersNielsen Жыл бұрын
    • Lol, You DO know it's banned in the main programming forums such as stackoverflow etc !! - do you know why?!! clue: massive bull + shitter

      @ChrisM541@ChrisM541 Жыл бұрын
  • 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.

    @norcal6181@norcal6181 Жыл бұрын
  • This is a very good video and many thanks to share files as well.

    @rolandgerard6064@rolandgerard6064 Жыл бұрын
  • 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.

    @btd6vids@btd6vids Жыл бұрын
  • brilliant as always

    @TheGadusi@TheGadusi Жыл бұрын
  • Thank you for making this! The old printer sounds during ChatGPT's output writing has me laughing out loud.

    @rufio.tf2@rufio.tf210 ай бұрын
  • 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 =).

    @ai15208@ai152088 ай бұрын
  • I love that comment, "I speak python with a C accent". I burst out laughing Great material man.

    @Teyros@Teyros Жыл бұрын
    • Much appreciated! :-)

      @DavesGarage@DavesGarage Жыл бұрын
  • This is all pretty amazing

    @wagsman9999@wagsman9999 Жыл бұрын
  • This was awesome thanks!!

    @lazerusmfh@lazerusmfh Жыл бұрын
  • Excellent video

    @LAWRENCESYSTEMS@LAWRENCESYSTEMS Жыл бұрын
  • Love the tape drive, with the old rabbit.

    @chuxxsss@chuxxsss Жыл бұрын
  • Going to be playing with this for sure

    @bit-tuber8126@bit-tuber8126 Жыл бұрын
  • Great proof of concept.

    @jlouis9686@jlouis9686 Жыл бұрын
  • Excellent tool for learning code and retaining it.

    @HikikomoriDev@HikikomoriDev Жыл бұрын
    • You DO know it's banned in stackoverflow etc !! - do you know why?!!

      @ChrisM541@ChrisM541 Жыл бұрын
  • I used ChatGPT for so many different things, from programming to playing science fiction RPG's to come up with story ideas :D

    @sjoervanderploeg4340@sjoervanderploeg4340 Жыл бұрын
  • The roman number system reported by ChatGPT forgot N (nil) which was rarely used, and only to represent an actual quantity of zero. It also forgot that historical examples used a subtractive notation that allowed more than one subtractive symbol or a subtractive symbol in a different register, like "IC" would be 99 instead of XCIX. The Latin word for 18 literally means 2 from 20 and so it was written as IIXX instead of XVIII (one fewer symbol). Even IIIC was used for 97 instead of IXVII. Whatever list of symbols are the shortest is the most historically correct answer, rather than "a correct" answer. Clay tablets apparently were too expensive to waste space using more symbols than necessary. Now, ask ChatGPT to create a CUDA program to mine Bitcoin in a way that is more energy efficient than the dedicated ASICs from Bitmain.

    @mjmeans7983@mjmeans7983 Жыл бұрын
    • Neural networks copy and combine. They don't create. It will be able to write something someone else has done (without giving any attribution). But not invent something new. There are no aha moments for a neural net. As for Bitcoin. It was designed to be wasteful. The solution is to simply design another crypto that is less wasteful.

      @RicardoSantos-oz3uj@RicardoSantos-oz3uj Жыл бұрын
    • @@RicardoSantos-oz3uj Your own brain is literally a neutral network.

      @user-nu5ib2ri9o@user-nu5ib2ri9o Жыл бұрын
    • Don’t forget that this thing programs on a whiteboard. Give it a computer to test its own code, and then see what happens.

      @user-nu5ib2ri9o@user-nu5ib2ri9o Жыл бұрын
    • @@user-nu5ib2ri9o My thinking exactly - give it the ability to actually *do* stuff, and the ability to learn from that, and the results could be world-changing.

      @thromboid@thromboid Жыл бұрын
  • Great video, Dave! I also believe that Chat-GTP will be an important tool for programming in the future!

    @GeorgesChannel@GeorgesChannel Жыл бұрын
    • Well at least it'll fix typos.

      @prozacgod@prozacgod Жыл бұрын
  • thank you for this information.

    @stevescheffler4219@stevescheffler4219 Жыл бұрын
  • 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.

    @DMS20231@DMS2023110 ай бұрын
  • 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.

    @midtskogen@midtskogen Жыл бұрын
    • 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.

      @ChrisM541@ChrisM541 Жыл бұрын
    • 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.

      @yourwallet4219@yourwallet4219 Жыл бұрын
    • @@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.

      @ChrisM541@ChrisM541 Жыл бұрын
    • @@ChrisM541 Not every statement has to be profound. Go kick rocks.

      @yourwallet4219@yourwallet4219 Жыл бұрын
    • Obviously it doesn't understand anything...it's a computer. Programmed to do something.

      @codytownsend3259@codytownsend3259 Жыл бұрын
  • Dave you're the best!

    @PizzaManNick@PizzaManNick Жыл бұрын
  • Thanks for the video, Dave. I didn't take ChatGPT seriously until January 6th, 2023. I thought it was all just chatbot tech. Then, a friend mentioned using it for coding assistance, and a Twitter thread made much the same point. Every day since then: OMG. My early take was this: Generative AI will democratize expertise like bullets democratized soldiers. If you follow a scientific process ("How might I be wrong about this?"), generative AI will open up all sorts of avenues of analysis and application, well beyond whatever field you might have been trained in. Anyone prone to confirmation bias is going to have a rough ride in trying to apply generative AI. But the bar for being productive in just about anything in the base corpus of ChatGPT or other generative AI has been drastically lowered.

    @wesleyelsberry5433@wesleyelsberry5433 Жыл бұрын
    • @Wesley, can you please help me with the twitter thread?

      @bryte_duffs@bryte_duffs Жыл бұрын
  • 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_kelly11 ай бұрын
    • @@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.

      @matt_kelly@matt_kelly10 ай бұрын
KZhead