Unlock Plus AI learning and gain exclusive insights from industry leaders
Access exclusive features like graded notebooks and quizzes
Earn unlimited certificates to enhance your resume
Starting at $1 USD/mo after a free trial – cancel anytime
The easiest way to create software in the AI era is no longer to type out code yourself. Instead, you should tell AI to do it for you. Telling AI what to do is called prompting. When given precise instructions, AI can do a lot of things for you. What I want to do in this video is share with you some best practices for prompting AI to create software for you. First, we'll walk through an example together. Then, you try yourself using any AI chat system, like ChatGPT, Gemini, Claude, or the one built right into this website. To use any of these AI systems, you give it a prompt or set of instructions like this. To tell it to create a webpage to help me write birthday cards, and when I give a person's name, age, and hobby, it should give me back a funny message. And if you do this, it might actually generate an app that looks like this, which is a good start. You can enter the name, age, and hobby, and it generates an okay message like this. But if you're unsatisfied with this, you might then continue the conversation with AI and say, make it prettier by adding a festive title and colors. And this would give you a second version of the app that now looks a bit better. And if you're still unsatisfied, you might say, display the color on the right side, make it look inside the birthday card, and get back a third version. And if you have ideas to make it even better, you could give it more instructions like add a fun title at the top, and so on. This is how I actually work in practice when using AI to write code for me. I often start off with a basic set of instructions and see what I get, and I repeatedly tell the AI how I want to improve it. It turns out that when you're building software applications, there's a number of basic building blocks you might end up including in the prompt. One thing I often include is the goal. So here are the goals to create a webpage to help me write birthday cards. Another thing you might include is to specify what is the input. That is, what does the user have to tell the software? This is us telling the software what we want it to output, as well as the layout. So what's on the left? What's on the right? How do you arrange the different parts of this app? And lastly, any special instructions for additional features you wanted to include. There are many ways to write good prompts, but as you start your journey of telling AI to build software for you, I encourage you to consider these five building blocks as common pieces that you might choose to include in the prompt. That is the goal, namely what you want to create, what input the user will provide, what is the layout of the software app, what special features you wanted to have, as well as what you want the software to output. In a previous slide, we went through a back and forth process of me incrementally, in four steps, adding to the instructions I gave the AI to tell it what I wanted to do. But if you already know in advance more or less what you wanted to build, you can also specify all of the building blocks in a single prompt. For example, if I already knew the specification I want for the software, I could write a single, much longer prompt like this to create a webpage to help me write birthday cards, whatever person's name, age and hobby, you have a fight message, you specify colors, and so on. And in this example, I've taken all five building blocks and written them all into a single, much longer prompt. So instead of building things step by step, like you saw in the last video, you can also give it all the instructions in a single, longer prompt, and that might give you a better first version of your app, which you can then further refine if it's still not quite what you want. Now, whether you're writing a single, long prompt all at once, or whether you're giving it one building block incrementally, one piece at a time, I will often start by telling the AI what is my goal, and then of the remaining building blocks, there are multiple ways to put them together, and you don't have to use all the building blocks every time, and the order is also not very important. Start to the goal and tell the input-output layout, and maybe not list any special features. Or you might put the building blocks together this way, and it could work fine. Or you might list out the building blocks in a different order, and the AI is usually pretty good at understanding these different rearrangements of the building blocks. And if you're feeling like, boy, this is a lot, I would say don't worry about it. If you just tell the AI whatever's on your mind, even if it's partial and imperfect, you can then work and go back and forth with the AI a few times to hone it towards something that you want together with the AI. One of the skills you hone over time is the ability to give AI more specific instructions, because it turns out that the results you get may vary even if you give fairly specific prompts. So here's a long, detailed prompt that you saw just now, specifying all of the five building blocks. And if you give these same instructions to the same AI system multiple times, maybe one time we'll give an app that looks like this, which is pretty nice, and maybe a second time we'll build something like that, and the third time we'll build something like that. And all of these look pretty good. We can see that there's some variation among them. In contrast, if someone were to give a much less specific prompt, a much less clear prompt, so it's a very short prompt that just says, create a webpage to help me write birthday cards. Because these are relatively vague prompts, the results you get if you run this multiple times through an AI system, maybe once you get this, a second time you get this, which looks totally different with different fields, and a third time you would get this, which again looks totally different than the first two times. The more specific and the more precise the prompts you write, the more predictable will be the results. But even then, there'll be a little bit of variability. So if you get results that are a little bit different than what I show in this video, don't worry about it. That's a normal cause of how AI systems behave. But if it surprises you with something you really don't like, that's okay too. Just give it additional instructions to steer or to move the AI closer to whatever you do want it to do. The best way to learn this is to put your hands on your keyboard and to try using AI yourself. Let me show you what it'll look like. What I'd like you to do after this video is go to this section on the website and go through this exercise yourself. So the instructions here that you can read later, but this is an AI system similar to ChatGPT and Gemini and Claude and so on. And I'm going to select and then copy and paste the first prompt here where it tells the AI to create a webpage, tell me to write birthday cards and so on. And I'm going to hit this to send it to the AI. So here, it'll think for a little bit and then it will generate an HTML page that it can then download and run. Notice while it's still running that this download button here is grayed out, so I can't actually click on it yet, but the AI system will take just a little bit of time to write something called an HTML page. This is what webpages are made of that will be this birthday card generator. Now that the AI has finished generating all of this HTML code, I can click this download button and here I'm running Chrome on a Mac. I'll show you later what to do if you're on a different machine and I can go to this downloaded menu here and open up file.html and this has created a little birthday card generator. So here's Karen 27 and I can create a simple birthday message. Not bad. And notice that this is actually a piece of code written in HTML that is running on your computer right now if you were to do this yourself. The code is in this file called file.html and it's actually saved to my computer right now and if you do this, it will be saved to your computer. Now, if you want to improve the code, you can then prompt it, add a festive title and colors and then it updates the code. Same as before, I have to wait until it's finished writing the code, if I can download it and now I can download it and same as before, open it. Oh, wow. Now it looks much more festive and so what I'd like you to do is try it out for yourself. You can, you know, add this third prompt, run it, add this fourth prompt or try some other prompts if you feel so inclined. But it's also fine to use just these four prompts one at a time and see what birthday card generator you get out of this process. Even though I'm showing you this process on the website, these same prompts should give you similar results on OpenAI's ChatGPT, Google's Gemini, Anthropic's Claude, or any other popular AI system. What you're learning isn't tied to any one platform and these skills apply to any AI system you choose to use. When you click the download button, your web browser will usually download the file.html or whatever is the file the AI generated with the code to your downloads folder. So these videos show you how you can navigate on either Windows or Mac to the downloads folder to find that file and then if you double click on it, it should open up in a web browser and let you see what the code you just generated looks like when it runs in your web browser. Please try this out. After you try out this process and generate a web app, one mindset I hope you have is that getting feedback is often a great step in building software applications. Whenever I write software, I'll often show it to friends, show it to family or sometimes respectfully approach strangers and ask if they're willing to look at whatever I'm building and see if they can let me know what they think or email it to a colleague or post it on my forum to get feedback because I find that when people look at it, they often have suggestions for how to make it even better or sometimes if you get a laugh out of a friend by showing them something funny, I find that really encouraging as well and gives me the energy to keep on going. So what I'd like you to do now is go into the next item in this course and try it out yourself. Get AI to generate some code for you and download the HTML file and see what results you get. If you feel so moved, I hope you also show it to a friend or show it to someone else to get their feedback. After that, please come back to the next video where we'll keep on working on the app and we'll look at how you can add even more features to the Birthday Card App to make it even more fun and interesting.