How I use AI coding tools as a Rails dev
It surprises me sometimes that a lot of devs are still not very bullish on coding with an LLM, so here is a little summary from a Rails dev in the middle of the usage spectrum about what I'm using the LLMs for and what my current toolset is.
A year ago, I made the funny mistake of buying GitHub Copilot for a year because it seemed like the best solution for JetBrains at the time. It's "funny" and a mistake because the landscape changes so fast that I think experimentation is essential for the years to come. Let me chat for a bit about all the tools I use so I can laugh about it again in a year or so.
My best prediction is that the whole midterm future of the "AI coding thing" is us collaborating with the IDE/editor about:
- Architect a solution.
- What code to write.
- What code to re-write.
All of it with minimal switching and copy-pasta between the place you write your LLM instructions and the code. I experienced this first hand on small greenfield projects with Rails and Python in Cursor, so I'm pretty sure Cursor is on the bleeding edge of the whole story.
Now, unfortunately, I can't make myself code in anything other than RubyMine so far when it comes to Rails. I'm trying to move to Cursor occasionally but keep switching back to it because it has everything I need for coding, debugging, and committing code out of the box. VSCode and Ruby LSP just don't cut it for me when I set things up manually, and I haven't seen grand automated setups yet. So, I will give you a breakdown of what I'm using LLMs for, what I tried, and what works well for me in RubyMine. Something similar might apply to you if you don't use Cursor and co; you might learn what you can look out for.
I use LLMs primarily for:
(in about this order of frequency)
- Debugging a specific error, explaining unclear/foreign language code or asking for a syntax bit.
- Autocomplete.
- Ask it to write specific code and ask it to write tests for the code (depending on the setup, in this or reverse order).
- Ask it general questions about the thing I'm working on. I could be curious about "why is it called normalizing a database schema?" or "who came up with the
i_suck_and_my_tests_are_order_dependent
- in minitest?"
- Formatting - like "rewrite this code in this format" or "create a markdown table for this list".
- Shaping and architecting the solution (less so for big professional projects, more so for greenfield projects).
- Asking it to write my code when my physical and mental resources are depleted, but I still wanted to ship that last be late in the evening. It's amazing how much more you can go nowadays, backed by LLMs. :D
LLMs don't have all the answers yet. So I'm probably using 90% LLMs - 10% Google nowadays.
Currently trying: Supermaven chat
I have been exclusively using the Supermaven autocomplete for over a year now. It's practical, fast and free.
The chat has some UX issues, but other than that, it works fine. I think it has some kind of a credit system. After 5 days, I'm halfway through my credits. I guess I'll need to pay more in the end if I want to keep using it. I don't see any greatness in reducing copy-pasta friction, and how the shortcuts work makes no sense to me. I think GitHub Copilot does a better job overall.
The UI is quite ugly, but that's normal for the JetBrains plugins. It sometimes does a better job formatting things than the GitHub chat.
Used for a year: GitHub Copilot
The autocomplete is very slow and of lower quality. As mentioned above, even when paying for GitHub Copilot, I was using Supermaven for the autocomplete. I'm pretty sure it's the way to go.
GitHub Copilot chat has good results, has some context awareness and seems to get new features frequently. It also has some inline code editing features and shortcuts that work, but it is nothing Cursor-like when it comes to reducing copy-pasta friction. Though, I see their features turning long-term into something like this if they keep developing it.
JetBrains AI Assistant
I'm secretly hoping that JetBrains' "AI Assistant" will become the world's number one AI tool in the future. But currently, out of all the tools I've played so far, it's first from behind.
- If you ask it to solve a problem, it's barely context-aware, gives you wrong advice and gets into loops quickly.
- Has slow auto-complete.
I think JetBrains gives you a short trial every time they ship a new major update to RubyMine and co. I usually try it for a day and get rid of it.
Claude
I sometimes use claude.ai for writing and visualizing a draft of something, like if I'm under time pressure to submit the RailsConf CFP in the next 1-2 hours. You can give Claude the context of your writing so you get results where you can actually use some snippets for your project.
Conclusion
A former colleague of mine - let's call him David (that's actually his name; he's great) - once said on a public call last year that AI was not groundbreaking for him in delivering technical solutions. I found it very interesting because, to me, it feels like LLMs have fundamentally changed my behavior while creating technical solutions.
Later, David told me that he actually uses AI quite a bit for finding information during coding, but it hasn't necessarily changed how he creates the final solution. Finding information is already a lot of what we do as devs, so it's funny how quickly we get used to a new technology like this and don't consider it groundbreaking. I can't measure the impact, but I feel that LLMs made my process quicker and easier.
I'm pretty sure that you should use a tool like Cursor in the mid-term and hack it out together with it. I should be using it too, already. 😅
But if you are a RubyMine degenerate like me, you will want a chat tool inside of your IDE so as not to switch between windows and at least have some bits of copy-pasta reduction and context awareness right in your pair programming AI partner chat box. The best tool for this at the moment is probably GitHub Copilot, but I will keep testing new subscriptions in the following months and let you know about the progress.