Finding the Best Solution with ChatGPT: A Personal Experience

When you're developing software for technically savvy users, you'll often encounter an annoying problem: users provide their preferred solution instead of their requirements.

This issue is even more pronounced when you are both developer and user.

In such situations, you're likely to choose the first solution that seems to meet your needs, even though there might be better alternatives.

Pair programming can help, as your partner can spot what's going on and suggest other ideas. But what if you're programming on your own?

That's where ChatGPT comes in handy.

ChatGPT to the Rescue

I've recently been working on an application that downloads interesting arXiv PDFs, and I wanted to access them remotely. I could think of a couple of ways to do that, but I decided to ask ChatGPT for advice. I used a prompt that had been helpful before:

"Suggest three ways I could accomplish that, with the pros, cons, and interesting features of each approach."

I presented my problem: I have a directory containing PDFs on a Raspberry Pi computer, and I want to be able to read the PDF files from Python on another Linux computer.

ChatGPT suggested three approaches, complete with pros and cons for each:

  1. File sharing with Samba
  2. Remote access with SSHFS
  3. Web server with a file browser

I had considered using Samba shares or a web server, but I had forgotten about SSHFS. Since I already had password-less SSH access to the Raspberry Pi, SSHFS was incredibly easy to set up, and it has been working very well.

Reusable Prompt for Problem-Solving

Here's the reusable prompt I mentioned earlier:

"Suggest three ways I could accomplish that, with the pros, cons, and interesting features of each approach."

I now use this prompt whenever I'm trying to find a solution to a problem, and ChatGPT consistently delivers valuable insights.

I'll share more useful prompts as I discover them. You can keep track of them by following me on Twitter at @rareblog.

Comments

Popular posts from this blog

Controlling a Raspberry Pi Pico remotely using PySerial

Five steps to connect Jetson Nano and Arduino

Raspberry Pi Pico project 2 - MCP3008