My Tentative Steps in AI Programming
II was quite skeptical when genAI came onto the scene. I could see potential in it but couldn’t see exactly where that potential lay. Sure, generating images and responding to chat messages are cool party tricks, but I was holding out on giving it any of my time until it proved to be more useful in the day-to-day. I think I can definitively say that time has come.
Grok
I first dipped my toe in with asking some simple questions of Grok. Those simple questions quickly turned into full blown research tasks. I went from “can my cat eat X?” to “give me a reading plan to learn basic accounting” in the span of a couple days. Best of all, it wasn’t plagued with hallucinations which was a recent hurdle for chat AIs.
It wasn’t till I read a blog post by Simon Willison that I decided to leap into leveraging AI for programming tasks. My first attempt was using Grok to create a simple bash script to streamline a routine task I did every morning. This task was to archive, sign, and encrypt my notes and upload it to my Google Drive as a backup. After a little back and forth with Grok, I had a working script that I use everyday! There’s still room for improvement (I still have to manually upload the file to GDrive) but this cut down the time I needed to complete this task dramatically.
My next task proved to be too much for Grok. I wanted to create a simple add-on for Anki. When studying my cards, I found myself stopping to add up the reviews at the bottom of the screen to see exactly how many cards I had left for the day. Wouldn’t it be convenient if the app did that for me? I gave Grok a link to the documentation, told it what I wanted, and let it think. After some time, it gave me a python script which I happily plugged into Anki and booted it up. It didn’t work at all. I believe I ran up against the biggest disadvantage for using a chat based AI to program. They simply cannot hold all the context needed for complex tasks.
Junie
I knew that my next step would have to be trying out one of the IDE integrated AIs but I wasn’t sure which. As I let this percolate in my brain for the next week, Jetbrains made a big announcement. They added Junie (an AI coding agent) and AI Assistant to all IDEs, created a free tier to try them out, and added pro access to existing payed plans. I already had their All-Products Pack so I got this new functionality to play with for no extra cost! After work that day, I decided to give it a try. After watching a few of their marketing videos on Junie, I realized that the best approach would be to download the Anki source code and work from in there so that Junie had all the context she1 needed. Since creating Anki add-ons was a completely new venture for me, I decided to first have Junie generate a document explaining the basics and best practices.
Feeling more confident with a little more knowledge, I gave her the task. She did complete it… But it wasn’t exactly what I wanted. My instructions were subpar, I needed to be more precise and verbose with my prompt. I reverted what she had done and tried again. This time, pointing her directly to the part of the code I wanted modified and telling her exactly how I wanted the end result to look. I also made sure to add that she should modify as little as possible to preserve compatibility with other add-ons. And it worked! She created quite an elegant little function that called the original, tacked on the sum text, and returned the newly modified text. She then takes that function and uses it to replace the original function. I’m going to try it out for a little bit on my own before I put it up on the official add-on page, but after looking over the code I’m pretty confident that there shouldn’t be any problems.
Next Steps
My next AI aided project idea is a bit more ambitious. I’ve been using Hugo to create my Neocities website up to this point. While I enjoyed it at first, I have quickly fallen out of love with it. First, I have very little knowledge of Golang so working with it’s template system has been difficult and I find it to be pointlessly long winded. Why do I need to format links like this: [my link]({<ref "/relative/path/to/link">})
2? It’s using FOUR different kinds of brackets! Second, it is very opinionated about how the files and folders are structured. I thought this would be a plus as I usually like when I’m given a structure to work within rather than being allowed to run rampant and make a mess of the folder structure. But I started to feel like the way Hugo wanted things done was antithetical to the way I wanted to work. Third, the terminal commands felt esoteric. EVERY SINGLE TIME I went to create a new content page I would get push back until I remembered that I needed to add “.md” to the end of the filename. Markdown is the only thing that Hugo works with. Why does it need me to tell it that I want to make an md file??? All these together has created too much friction to be tolerable anymore.
I set myself a goal to publish an article here once a month3. I’ve failed that already. And though I am ultimately to blame, Hugo was a major reason for my avoidance. Over the 30 years I’ve been alive I’ve found that the smallest amount of friction can prevent me from getting things done. If I want to continue publishing these blogs, I need to smooth out the process. Before I settled on Hugo, I made my own half-assed attempt at a static site generator. How hard can it be? Obviously it was harder than I was willing to deal with at the time. But now, with Junie, I feel like I could take another stab at it. I should be able to iterate much faster and get a minimal viable product working in a matter of days if not hours.
This is the biggest power I see in AI aided programming. I can take on more ambitious side projects than I could have ever dreamed of before. Tasks that would have devoured a whole weekend can now be completed in an afternoon despite being tired from working all day. It also gives me incentive to complete the small ideas that I just couldn’t motivate myself to do because the potential benefits didn’t justify the time cost. When the time to complete them get packed down to a few minutes of just telling Junie what I want, every idea becomes viable! I feel like I’m finally able to be the kind of person who works on personal projects in her spare time and creates interesting and useful things. There is definitely reason to be cautious when using AI for larger production-level programs. But for the things I want to make right now, it’s honestly turned out to be a godsend.
-
Interesting that I’ve subconsciously assigned a gender to a non-living entity. As far as I can tell, all the official literature uses “it”. For some reason “she” feels right to me. Is it just the feminine sounding name? Probably. Though I think of Grok as an “it” and not a “he”. My guess is that Junie’s name feels more human than all the other AI’s. ↩︎
-
This template actually has two curly braces but I left one out so that Hugo doesn’t actually create a link from this example. ↩︎
-
I know that is a very low bar but I’m new to this whole blogging on the internet thing so I wanted to set a realistically attainable goal. ↩︎