Summary (TLDR)
This article will give you a sneak peak into how a more technical person (such as a developer) interacts and engages with ChatGPT. In this post I've shared a ChatGPT transcript that shows the 68 prompts it took to create a proof of concept for an app that collects and stores SEO data from a 3rd-party API.
More and more people today are learning to use AI in advanced ways, with some people even creating small apps and scripts with the help of AI.
In today's day and age, the gap between a layperson with little technical knowledge, to someone who can create a tool like this using a similar process is getting smaller every day.
So, I thought it would be useful to share a glimpse into how a developer interacts and engages with AI to create something that's a bit more advanced than a simple script.
In this article, I'm going to share a ChatGPT transcript for a 2 hour "AI programming" session with ChatGPT. The goal was to create a small app/tool that could solve a problem we faced in our agency.
The purpose of this article is to give you inspiration and show you advanced ways that AI can be used. It's not intended to be a tutorial, but rather an over-the-shoulder view of what can be done.
My suggestion is to not look at the transcript and say "but I wouldn't know to ask AI those questions". Rather, take this as an opportunity to expand your tools and your thinking to understand the types of prompts that could be helpful for you, and have AI do the work you would otherwise not be able to do on your own - such as designing a database.
The problem we wanted to solve was that we needed a way of tracking details about the Google Business Profiles for our clients' competitors. Primarily, we wanted to track the number of reviews that these competitors had, and how fast they were acquiring these reviews (review velocity).
Note: There are other solutions on the market that do this type of analysis and monitoring. This article isn't intended to be a "better solution" to those off-the-shelf options. We could have purchased an off-the-shelf solution, but at Propel we like innovate and push the boundaries of what we do for our clients. So, I did this to take on a challenge.
As you'll see in the ChatGPT transcript I've shared, I asked ChatGPT about the problem and what possible solutions it could recommend.
We settled on the following setup:
Note: I have very little experience with Google Cloud Platform. We do have several tools and APIs we leverage from Google Cloud Console, but I consider most of the experience I have as being fairly "surface level". I've never used any of the recommended tools (Cloud Functions, BigQuery, Cloud Scheduler) for any significant amount of time before this. I do have a decent amount of experience designing databases.
Secondary Note: AI does make mistakes so if you do undertake something like this - make sure to save your code often. AI also may not have up-to-date information on certain technologies or coding languages. So I would NOT recommend using AI code from ChatGPT for production. Always have an experienced developer review and possibly improve the code.
Here's what I wanted the application to do:
The whole process took a total of 68 prompts and about 2 hours to go from absolute zero to a working concept.
This included the prompts to research the implementation, such as:
The end product is a working app that does exactly what I had set out to do. The concept still requires further edits and improvements, of course. But the goal wasn't to create a final and polished app. The goal was to determine feasibility and shortcut the process so that we can hand this off to a python developer and have them take over from here. And although this will also save us a lot of time with planning, communicating, and briefing the python developer - this was mostly just a fun project I wanted to take on.
You can download the ChatGPT transcript below. There are two versions available, one which is text-only, and the other which is a PDF with a screenshots of the entire process.
Below is a list of my helpful suggestions and observations that I think are worth pointing out.
Instead of asking AI to create a full-fledged app, with complex inputs, outputs, and functionality, break the process up into small steps. Coding the app with AI using this approach allows you to ensure that each step of the process is functioning exactly the way you want it to. It also makes for easier debugging and troubleshooting if you encounter problems or errors with the code or functionality.
When coding anything with AI, I highly recommend asking AI to include verbose output in the code execution that describes and logs what each step of the code does. What this does is produce output in the execution log that explains what each step of the code is supposed to do. So if an error occurs during execution you can copy and paste the verbose output including the errors and share it with the AI. Since the AI knows where each "output comment" is triggered (because it added those comments to the code), it can track down where the error occurred in the code to a much higher accuracy.
You can use a prompt like this (untested):
Add code to the project that describes and logs what each step of execution does so that we can review the execution log if an error occurs and identify where the error was triggered in the code.
As a developer, I knew that I should get AI to separate certain code into separate files to keep the code more organized. Consider asking AI to do this analysis for you. You can try using a prompt like this (untested):
Can you suggest a way to structure the code for this project into separate files to keep the code organized, modular, scalable, and flexible?
You can do the same with a database as well. My recommendations are to ask the AI to plan and/or design the database for you. Here's a prompt you can try out (untested):
Please plan a database for this project that will support the desired functionality. Please ensure the database follows best practice for modular and scalable database design.
During the process of designing the database, I asked ChatGPT about primary indexes for database tables. ChatGPT replied that BigQuery does not support primary keys, and said that BigQuery offers partitioning instead of primary or secondary keys. A colleague of mine Vinay Karanam, pointed out to me that this was in fact incorrect and that BigQuery does support primary and foreign keys. This mistake was likely due to outdated training data available in OpenAI's models.
If in doubt, question the suggestions or output from AI. When AI is asked to consider it's suggestions against a concern you have, it will either offer reassurances as to why the suggestion is accurate or apologize for not factoring in your concerns and offer a better solution that takes your concern(s) into account.
Use AI coding as a way of helping you create working concepts or as a way of making a technical person more efficient and effective at their job.