From the course: Build with AI: Beyond Pair Programming with AI

Unlock this course with a free trial

Join today to access over 25,000 courses taught by industry experts.

Code from a chat (ChatGPT)

Code from a chat (ChatGPT)

- [Instructor] So far, I've been demonstrating how to use AI coding tools in context inside an IDE. And this is the most natural entry point, but it's not the only entry point for this. You can also use standalone AI chat tools like ChatGPT to perform the same types of tasks. The main difference is you're no longer working inside an IDE so if you want any of this code to run, you need to copy and paste it into an IDE. But there are advantages to using ChatGPT or another chat interface to generate code in that you can then isolate your conversation. It's not in context, it's not going to mess with any of the other code, it's also not going to look at any of the other code, and it's a very nice confined space to work on code. There are a couple of things you can do here. So first we can just ask ChatGPT to generate some code for us. I'll say create a react component using TSX, using TypeScript that has an input field for latitude and longitude and submits button and validates the values…

Contents