From the course: Mastering AI Tools for Efficient C# Development

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Documenting your code with ChatGPT

Documenting your code with ChatGPT - C# Tutorial

From the course: Mastering AI Tools for Efficient C# Development

Documenting your code with ChatGPT

- [Instructor] In the previous video we discussed using GitHub Copilot to help us add comments as we wrote and generated our code. Now we'll look at how ChatGPT approaches the same tasks. For this scenario, I'm going to have ChatGPT open in my browser on the left and my code on the right. This is something to keep in mind when using ChatGPT over Copilot since it's not built into the IDE. So the first thing I'm going to do is copy all of the code we created previously, including its comments, and I'm going to tell ChatGPT to strip it of all the comments. Now as you can see, ChatGPT is going through taking the code that already exists and removing all the comments that we had previously. This also tells ChatGPT, the structure of the code. So now it can keep this in memory. In order to take code from ChatGPT and put it back into our application, simply look for the copy code button at the top of the code block and then we can go back over to Visual Studio, select all and just paste it…

Contents