Kevin Riemer – Post #3

This week, I focused on both frontend and backend work. ChatGPT was helpful, but also fell short in some areas!

On the frontend, I tidied up our login page and our user-home page. Dev picked out some colors for another page of our web app, so I wanted to match them to remain consistent throughout our app. ChatGPT nailed this, and was able to use the hex color code I input to achieve what I needed to do in CSS.

The tougher part came when I worked on integrating the frontend to our backend. The first step was initializing a connection to our project in Firebase. ChatGPT was really helpful in helping me learn about Firebase, including how it works and why it is used. I had no prior experience with Firebase, so this was great for me to gain understanding. When I asked ChatGPT to help me implement the Firebase connection in Javascript code, the code it generated was about 80% correct. It nicely formatted each component of the initialization process and it clearly indicated what variables I needed to update with my specific information (e.g. API keys, etc.). However, it had incorrect and outdated syntax for the actual initialization of the firebase app connection. In a previous blog post, I already discussed that ChatGPT is not great at debugging.

But I really want to reiterate that fact. ChatGPT is pretty bad at it.

When I asked more specific questions about the error, it generally just repeated itself and listed the same methods to potentially resolve the error. Or, it re-generated the same code using a slightly different approach, which was still wrong. I had to scour the Firebase documents to find the updated syntax for initialization. I got this working such that a new account would be added to Firebase when a new user creates an account on our web app. I then turned my attention to our MySQL database because I wanted the new account to be added to that as well.

The next major issue I encountered was with the MySQL query in which I was trying to add a new user to our users table. The actual syntax of the query that ChatGPT generated was just ever so slightly off, so our database kept throwing syntax errors at me. Since, ChatGPT is so bad at debugging, it was no help to me. After a while of searching the internet, I found the root of the problem. First, ChatGPT was not correctly extracting the JSON data from the body of the HTTP POST request. Once I fixed that, I figured out that the actual query for insertion simply did not have quotes around each value I was trying to insert. Once I added those, I was in the clear.

This week showed me that AI can really help you understand something pretty well, even if you had no prior experience with it. Generally speaking, it can get you about 80-90% of the way to your goal. But, getting that last 10-20% can be very challenging using solely AI.

Next week, I look forward to exploring data storage during a user’s session.

Print Friendly, PDF & Email

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *