This past week, I focused on additional content/pages to add to our project, as well as improving the frontend design of our website. There were definitely some more lessons I learned about AI along the way this week.
It was very apparent to me this week that when working with multiple code files, you need to make sure that the AI knows which files you are talking about AND that it knows the most up to date version of each file. I learned this the hard way, when ChatGPT updated a couple of my code files but they were a little older than what I was actually working with. To rectify this, I had to go back and find the lines that it omitted and add them back. I found what works best is telling ChatGPT the name of each file that you provide, and making sure to let it know when you update the file. This way, it can more easily distinguish between files and you know it will always have the most updated version of the file.
The other lesson I learned this week was that you have to specific if you want AI to generate code for a certain area of your code. In this particular instance, I wanted it to write a function for me to add a feature. In my query to ChatGPT, I simply input my entire code file and there was a comment in there where I wanted it to generate the code. This did not work at all. It completely ignored that comment and wrote it elsewhere. In this instance, it actually wrote the code inside a different function that I didn’t want it to alter. Instead, what worked better was simply creating the function signature/empty function body and asking ChatGPT to finish the function for me while describing what I needed the function to do. This worked much better for me.
Finally, I learned that ChatGPT is not very good at explaining certain overarching principles of frameworks. For instance, this week it wanted me to add a Next.JS component inside one of my webpages. However, Next kept giving me an error because I didn’t have certain thing correct in Next’s file structure. When I asked ChatGPT for help, it was pretty unhelpful and I had to rely on the internet for answers instead. It is apparent to me that AI assumes you have things setup in a certain way, or at least that you know enough about the framework you are working in to troubleshoot errors like that.
Overall, this was another great week. I’m looking forward to the homestretch of this project!
Leave a Reply