The AI Coding Journey: From Copilot to Gemini Pro
As we all know, AI is the current "it" thing. I’ve been using it for everything from household fixes to troubleshooting complex phone settings. For example, I finally configured my phone to stay on DND for everyone except my contacts—a task significantly more complicated than it sounds when you're balancing multiple Google Voice and carrier numbers. Recently, however, I decided to see what AI could do for my coding workflow.
I started with GitHub Copilot in VSCode, which was decent until I hit my monthly query limit. I then pivoted to the Google Gemini Pro Trial (a 12-month free pass), which also integrates directly into VSCode.
The Good, The Bad, and The "Try Again"
Using Gemini is simultaneously amazing and frustrating. The "diff-like" interface for approving code changes is brilliant. However, the experience degrades over long, protracted conversations; the history helps the AI stay context-aware, but it makes the response time crawl.
I’ve also encountered several technical quirks:
- Failed Applications: Sometimes it fails to modify the file, requiring a "Try again" prompt.
- The "Unknown Problem": Occasionally, it hits a wall that requires a full VSCode restart.
- Loss of Agency: It’s easy to let the AI inject so much code that you no longer fully "know" your own project.
A perfect example of AI going down the wrong path happened while I was building a YouTube downloader. The AI insisted on using a complex PHP OOP library to wrap yt-dlp and ffmpeg. We spent hours fighting version mismatches between the apt version of yt-dlp and the GitHub binary. Finally, I had to step in: "Wait—I can run this perfectly at the command line with a cookies.txt file. Let’s jettison the library and just have PHP construct the shell command." It was a reminder that while AI is a powerful tool, it still needs an experienced dev to keep it from over-engineering itself into a corner.
Modernizing MAPS with Gemini
For the uninitiated, MAPS is my homegrown spam filtering system. It triggers from a user’s ~/.forward file, extracts the "From" address, and checks it against a MariaDB backend.
- Whitelist: Delivered immediately.
- Blacklist: Bounced with a "Not allowed" message.
- Nulllist: Silent discard.
- Unknown: The email is held, and the sender gets a registration link. If they click and identify themselves, their mail is released, and they are whitelisted.
Recent AI-Assisted Improvements:
- Persistent Sessions: Gemini helped me rewrite the login logic so the session cookie refreshes every time I visit the site. Instead of a hard 30-day expiration, it now only expires if I haven't logged in for 30 days.
- Subject Line Encoding: We’ve been working on better handling of non-ASCII subject lines. It's a work in progress—getting diverse character sets (like Chinese) to render correctly is a moving target.
- Safe HTML Rendering: This was a huge win. Previously, my email display was "raw" (and ugly) to prevent scripts or worms from executing. The AI implemented a sanitization module that:
- Strips all scripts.
- Disables all href links.
- Converts links into "hover-only" tooltips so I can see the URL without the risk of clicking it.
Next, I moved on to my most ambitious change yet...
Android App - MAPS Mobile
Take aways
- AIs aren't always right. You need to guide them. In order to guide them, you need ot know what you are doing. College grads and others are trying to enter the field because they see it as the next big thing, but often lack the background to properly guide the AIs
- Many businesses will miss this as they eye the bottom line (i.e., cost $$$) before understanding the practicality of this, much like they invested a lot into offshore tech support without asking the question: Won't this worsen communication between our employees and customers?
- AI needs to be told when there is a better, more architecturally intelligent path. I.e. You still need qualified people
- Coding with your vibe buddy, Mr. AI, needs to be learned like anything else
- Vision you and your AI buddy to be a team, not a substitute.
No comments:
Post a Comment