ChatGPT: debugging without StackOverflow or Google
A few days ago I decided to finally get back to writing on this blog after almost one year of silence. Once my text was completed I published it and proceeded to share it on Twitter, then noticed that there was no thumbnail image on the shared link.
Years ago I implemented a feature that automatically generates featured images for new blog posts. Whenever you click “Publish”, WordPress checks if there’s a featured image set. If there is none, it generates a SVG image, converts it to PNG using Inkscape, adds it to the WordPress Library and finally sets it as the featured image of the blog post.
I logged into my server, activated the debug mode on WordPress, and proceeded to investigate what was going on. First, I fixed some warnings that were not actually causing the problem but had to be fixed just because. Then I found out what was causing the featured images not being generated.
The problem was related to Inkscape. In a recent update, some of the command line arguments of the
inkscape command-line tool were changed, and one of the arguments that I was using before became invalid. It was a matter or replacing
-o and the problem was gone.
What impressed the most about this situation is that, for the whole process of debugging all the warnings and errors I haven’t resorted to Google nor StackOverflow a single time. Instead, I asked all my questions to ChatGPT and it gave me useful answers every single time, going as far as to explain me internal WordPress functions.
Coding with ChatGPT as your pal has to be one of the most satisfying experiences I have ever had in tech. It makes the whole process fluid. You stumble upon an issue, you ask ChatGPT a question about that issue and get a useful, detailed answer that, if doesn’t solve the issue completely, gets you closer to solving it.
I can only wonder what this technology will be able to do in the near future.