Hi all,
They say that if a man says he'll do something, you can trust that it will be done; there's no need to remind him every six months. Something about that saying cracks me up every time, and it's appropriate for today, as I'm coming back to a project from several months ago, although this time, with a second dose of effort and a revised approach to using AI.
To catch you up, my project was around the theme of internet addiction, and trying a new approach to managing my browsing behavior . Rather than block content entirely, I would just make it boring. So instead of the random rewards driven dopamine hit of unpredictable fresh content, I'd just serve the same content over and over until the following day.
In my first attempt, I found some hack workarounds for Gmail, The New York Times, and Hacker News. For example, The NYT and Hacker News both had a url called /frontpage
, which only updated once a day, so I'd just redirect visits to those pages. That really helped change browsing behavior for me. Reddit remained a rabbit hole, because their "frontpage" updated every few minutes with fresh content, which was exactly the problem.
My hack fix wasn't going to work, so I tried some strategies where I'd cache the HTML and then try to serve that. The problem was that the page wouldn't work quite properly without JavaScript, and when I tried to get scripts to run, I'd hit cross-site scripting issues that were blocked for (good) security reasons. When I tried to ask an AI agent to solve the problem, it would go in circles, trying one approach, then another, then would forget the first way didn't work and it would try it again. I tinkered with it for a while, but eventually just threw up my hands in frustration.
But these things tend to rattle around my brain, and like I said, if a man says he'll do something, you can consider it done. Fast forward several months. Maybe the AI models are better, but there were also some new AI techniques I wanted to try.
In short, rather than asking the AI to just build the thing and provide feedback along the way, this time I asked it to make several documents up front. I asked for a requirements doc (which I prompted it to tweak) an architecture / technical approach doc (which I also prompted it to tweak), and a task by task project plan. This was strangely similar to my job as a product and program manager, where the point of all those docs is to build shared understanding and alignment with the team, but this time, I was building context for the AI.
The AI was still incredibly knowledgeable and strangely dumb, but by prompting it to update the docs and the project plan, I felt like I had at least wrangled it and could manage it. For example, it wanted to build an incredibly complicated caching system, but by prompting and tweaking the project plan, I was able to get it to scale back from a layered architecture that took several hundred lines of code across four files, to something in about 50 lines in one file that made much more sense to me.
The AI agent also came up with a workaround for the cross-site scripting issue that I hadn't thought of. One of the big problems I had on the first go round was trying to pause, or delay, or insert my own onDocumentReady()
function to get the JavaScript to work on the injected content. With the context of the technical architecture doc and the project plan, the AI didn't go in circles, but came up with a clever approach to call Reddit's own JavaScript onDocumentReady()
function manually, after the cached content had been inserted. It worked perfectly.
So now, if I go to Reddit, I see the same content I first saw, along with a little toast notification telling me how many times I visited already that day. Based on past experience, I'm fairly certain that without the dopamine hit of fresh content, the repeated page visits will fade.
So that's my round two with AI. Far more productive. And I'd definitely call this a case of working with the AI instead of being replaced by it. The AI knows far more about Chrome's APIs and what was available for building an extension and I was able to provide some supervision and stop it from going off the rails.
Best regards,
Sam Feller
aka THE Awkward Engineer.
p.s. I had a friend who pointed out that the news used to come once a day, with news from yesterday, and we liked it. That still makes me chuckle.
p.p.s. - The AI is responsive to feedback in a strange way. When something seemed odd and I'd ask, it would enthusiastically respond and tell me I was "absolutely right!" If I was truly dead wrong, it would hold its ground. I wondered how often I was leading the witness and would occasionally phrase question in different context windows to see if I'd get different answers, which I sometimes did.
I also noticed that if I asked the AI if there was anything to refactor or simplify, it ALWAYS found low hanging fruit, which made me wonder why it didn't do that itself on the first pass. Again, maybe that's similar to how real developers work, where getting it working and getting it clean are often two steps. Food for thought.