1 00:00:00,000 --> 00:00:09,344 [MUSIC] 2 00:00:09,344 --> 00:00:12,438 Hi, I'm Laura, an instructor here at Treehouse. 3 00:00:12,438 --> 00:00:17,414 In this video we're going to explore the incredible capabilities of ChatGPT 4 00:00:17,414 --> 00:00:19,337 in the world of programming. 5 00:00:19,337 --> 00:00:24,119 We'll dive into the ChatGPT website, discover its functionalities, and 6 00:00:24,119 --> 00:00:26,969 witness how it can assist us as programmers. 7 00:00:26,969 --> 00:00:32,078 Get ready to unlock the power of AI and take your coding skills to the next level. 8 00:00:32,078 --> 00:00:33,668 Let's get started. 9 00:00:33,668 --> 00:00:37,386 If you're unsure of what ChatGPT is, or even AI, 10 00:00:37,386 --> 00:00:41,911 I recommend watching our What is AI, What is ChatGPT video. 11 00:00:41,911 --> 00:00:43,693 There's a link to it below. 12 00:00:43,693 --> 00:00:49,147 To get started, open up your browser and head on over to the ChatGPT website. 13 00:00:49,147 --> 00:00:51,658 You can find a link to it below. 14 00:00:51,658 --> 00:00:57,720 Log in with your OpenAI account or click the sign up button to create an account. 15 00:00:57,720 --> 00:01:02,875 Now that we're on the ChatGPT website, let's see what ChatGPT is capable of. 16 00:01:02,875 --> 00:01:07,925 We'll start by asking ChatGPT, what are some things you can do? 17 00:01:14,871 --> 00:01:19,059 As you can see ChatGPT can do more than just answer questions. 18 00:01:19,059 --> 00:01:22,844 It can generate text, translate language, 19 00:01:22,844 --> 00:01:27,635 assistant writing, provide explanations, and more. 20 00:01:27,635 --> 00:01:30,988 You'll be surprised by the depth of its knowledge and 21 00:01:30,988 --> 00:01:33,455 the natural flow of the conversation. 22 00:01:33,455 --> 00:01:38,418 Now let's dive deeper into what it can offer to us as programmers. 23 00:01:38,418 --> 00:01:43,104 As programmers, we often encounter challenges that require assistance and 24 00:01:43,104 --> 00:01:43,832 guidance. 25 00:01:43,832 --> 00:01:47,990 ChatGPT can be a valuable companion in such situations. 26 00:01:47,990 --> 00:01:54,441 Let's ask ChatGPT, I'm a programmer, what are some things you can do to assist me? 27 00:01:58,837 --> 00:02:02,712 ChatGPT offers us a wide range of support. 28 00:02:02,712 --> 00:02:06,774 It can provide code assistance, error debugging, 29 00:02:06,774 --> 00:02:11,771 code review, and provide guidance for best practice and more. 30 00:02:11,771 --> 00:02:16,023 Let's explore some of the ways it can assist us in our programming journey. 31 00:02:16,023 --> 00:02:22,433 When faced with complex code or concepts, we can turn to ChatGPT for explanations. 32 00:02:22,433 --> 00:02:26,325 It can help us understand the underlying principles and 33 00:02:26,325 --> 00:02:29,814 provide insights to enhance our understanding. 34 00:02:29,814 --> 00:02:30,779 For example, 35 00:02:30,779 --> 00:02:36,175 I want to understand this code snippet from the how to install Python workshop. 36 00:02:36,175 --> 00:02:41,045 If you just send ChatGPT the code with no context, it does give you 37 00:02:41,045 --> 00:02:46,362 a small description of the function and how the function would run, but 38 00:02:46,362 --> 00:02:51,604 I'm a beginner in Python and don't understand any of the syntax yet. 39 00:02:51,604 --> 00:02:55,907 To improve ChatGPT's response, we'll provide it more information. 40 00:02:55,907 --> 00:02:59,903 When sending a message, I found that the results come out better when you pretend 41 00:02:59,903 --> 00:03:01,735 you're talking to another person. 42 00:03:01,735 --> 00:03:04,642 So I'll type, I'm a beginner in Python. 43 00:03:04,642 --> 00:03:09,434 Can you explain the code line by line and point out any syntax? 44 00:03:14,203 --> 00:03:17,368 Now this explains the function much better. 45 00:03:17,368 --> 00:03:21,167 Sometimes we need a fresh pair of eyes to review our code. 46 00:03:21,167 --> 00:03:25,325 ChatGPT can act as a code reviewer, suggesting improvements and 47 00:03:25,325 --> 00:03:30,326 adding valuable comments to enhance the quality and readability of our code. 48 00:03:30,326 --> 00:03:33,714 Let's ask ChatGPT, how would you improve this code? 49 00:03:39,482 --> 00:03:42,356 It's recommending some input validation, 50 00:03:42,356 --> 00:03:47,204 separating our function to improve code modularity, and handling error. 51 00:03:47,204 --> 00:03:51,109 It even provided us with an updated version of our code. 52 00:03:51,109 --> 00:03:54,977 But it doesn't look like ChatGPT accounted for 53 00:03:54,977 --> 00:03:58,851 different capitalization like it suggested. 54 00:03:58,851 --> 00:04:02,369 While ChatGPT is an incredible tool for programmers, 55 00:04:02,369 --> 00:04:05,511 it's important to recognize its limitations. 56 00:04:05,511 --> 00:04:10,368 Occasionally, it might generate incorrect or incomplete answers. 57 00:04:10,368 --> 00:04:14,173 In such cases, you can politely indicate the issue and 58 00:04:14,173 --> 00:04:17,329 ask for clarification or a better solution. 59 00:04:17,329 --> 00:04:23,356 Additionally, remember that ChatGPT may not always have real-time information or 60 00:04:23,356 --> 00:04:26,627 access to specific libraries or frameworks. 61 00:04:26,627 --> 00:04:31,371 Let's indicate to ChatGPT that it didn't account for different capitalizations. 62 00:04:35,240 --> 00:04:40,489 Great, it recognized its mistake and provided us with the improved code. 63 00:04:40,489 --> 00:04:45,630 Debugging can be a challenging process, but with ChatGPT we can see guidance and 64 00:04:45,630 --> 00:04:48,663 identifying and resolving issues in our code. 65 00:04:48,663 --> 00:04:52,166 It can provide us with suggestions, strategies, and 66 00:04:52,166 --> 00:04:55,223 alternative approaches to tackle those bugs. 67 00:04:55,223 --> 00:04:59,243 In a project I'm working on, I'm getting this error in the console. 68 00:04:59,243 --> 00:05:03,185 Let's test out ChatGPT debugging skills. 69 00:05:03,185 --> 00:05:10,045 I'm gonna ask ChatGPT, I'm getting this error in my code, what does it mean? 70 00:05:10,045 --> 00:05:10,787 How can I fix it? 71 00:05:15,220 --> 00:05:19,155 Awesome, it just let me know what my error stands for and 72 00:05:19,155 --> 00:05:21,600 how to resolve my issue, thanks. 73 00:05:21,600 --> 00:05:26,130 Chat GPT's assistance goes beyond code explanation and debugging. 74 00:05:26,130 --> 00:05:29,893 It can also provide us with ready-to-use code snippets and 75 00:05:29,893 --> 00:05:33,813 offer advice on how to approach our next programming project. 76 00:05:33,813 --> 00:05:38,642 Whether it's a specific algorithm implementation, a utility function, 77 00:05:38,642 --> 00:05:40,604 or a common programming task, 78 00:05:40,604 --> 00:05:44,383 ChatGPT can generate code snippets tailored to our needs. 79 00:05:44,383 --> 00:05:49,611 It saves us time and serves as a helpful resource in our coding endeavors. 80 00:05:49,611 --> 00:05:51,428 Let's give this a try. 81 00:05:51,428 --> 00:05:58,759 I'll ask ChatGPT to write me an HTML page that contains a big red circular button. 82 00:05:58,759 --> 00:06:02,760 Inside the button should be the text, Do Not Touch. 83 00:06:02,760 --> 00:06:06,792 When the mouse hovers over the button, the button should immediately disappear. 84 00:06:11,586 --> 00:06:15,536 I'll copy the HTML over and run it in the browser. 85 00:06:15,536 --> 00:06:17,498 Wow, it did it perfectly. 86 00:06:17,498 --> 00:06:19,055 Why don't you give it a try? 87 00:06:19,055 --> 00:06:24,205 Ask ChatGPT to create a function to help you in your next project. 88 00:06:24,205 --> 00:06:29,201 Another fantastic feature of ChatGPT is its ability to offer project 89 00:06:29,201 --> 00:06:31,278 suggestions and guidance. 90 00:06:31,278 --> 00:06:35,911 Let's ask ChatGPT for inspiration on what we should build next. 91 00:06:35,911 --> 00:06:39,484 What are some beginner friendly apps I can build using JavaScript? 92 00:06:45,111 --> 00:06:47,819 Fantastic, ChatGPT has provided us 93 00:06:47,819 --> 00:06:52,373 with a list of beginner friendly app ideas using JavaScript. 94 00:06:52,373 --> 00:06:56,545 Now, let's dive deeper into option 4, as it's caught my attention. 95 00:06:56,545 --> 00:06:59,792 We'll ask ChatGPT for further guidance, 96 00:06:59,792 --> 00:07:03,408 I really like option 4, how can I get started? 97 00:07:03,408 --> 00:07:05,438 Can you give me a step by step guide? 98 00:07:10,917 --> 00:07:16,498 Great, ChatGPT has given us a step by step guide to get started on option 4. 99 00:07:16,498 --> 00:07:19,589 Now here's where ChatGPT shines even more. 100 00:07:19,589 --> 00:07:22,139 You can ask it to break down each step or 101 00:07:22,139 --> 00:07:25,341 help you with any specific part of the process. 102 00:07:25,341 --> 00:07:30,883 It's like having your own personal coding buddy by your side at all times. 103 00:07:30,883 --> 00:07:32,150 And there you have it. 104 00:07:32,150 --> 00:07:38,223 We've explored the incredible capabilities of ChatGPT as a programmer's companion. 105 00:07:38,223 --> 00:07:41,553 From code explanations to project advice, 106 00:07:41,553 --> 00:07:45,970 ChatGPT is a valuable AI tool in our programming journey. 107 00:07:45,970 --> 00:07:50,253 Now, this is just the tip of the iceberg of what ChatGPT can do. 108 00:07:50,253 --> 00:07:53,397 To explore what else you can do with ChatGPT or 109 00:07:53,397 --> 00:07:58,363 even how to incorporate it in your next project, I've added some links 110 00:07:58,363 --> 00:08:02,694 below to more chat GPT content and a link to all our AI content. 111 00:08:02,694 --> 00:08:04,830 Thanks for watching and happy coding