Since everyone else is doing it, I’ve started using GitHub/VS Code Copilot AI for programming a little more in earnest. Until now I really only used it to generate a few scripts. Now I’ve started using AI in a few places as a quick start to get a new project up and running and testing it out.
I’ve generated and worked on a few Rails projects, plus an Astro blogging website (which I might use soon, bye bye WordPress). It was interesting to see where the AI excelled and where it had trouble.
Struggle: Adding Tailwind to a Project
Copilot would sometimes struggle to add Tailwind to a new project. I thought it was interesting that it happened to both Rails and Astro. If/when it ran into a problem Copilots would automatically decide to downgrade from Tailwind 4 to Tailwind 3.
Ironically adding Tailwind to Rails is as simple as using the tailwindcss-rails gem, and adding it to Astro is almost as easy with a Vite plugin. When I would stop it from doing a downgrade and say “Instead I want you to take out the current Tailwind CSS inclusion and use the instructions on https://tailwindcss.com/docs/installation/framework-guides/astro to use the Vite plugin” the AI would respond with “Oh you’re absolutely right!” and go on with it that way.
Struggle: Adding React to an existing Rails Project
This was hit-or-miss. Sometimes it worked, sometimes it failed. If I told it to use Webpacker or another bundler besides the Importmap that rails new
defaults to then it would often go a lot faster and with fewer struggles.
This is where already having programming experience helped to smooth out the problems.
Another struggle: JS vs JSX
In one situation, after adding React to my project, it created App.js
with JSX in it. Of course there was an error, but the AI wanted to rewrite the JSX using React.createElement
for all of the JSX!
Needless to say: I was not a fan of this solution.
Struggle: Generating a new Model in Rails
It was another funny observation I had: whenever I asked Copilot to create a new model it would start with rails generate migration
instead of rails generate model
. The AI didn’t use the rails scaffolding tools well, instead it would work in its own step-by-step procedure.
Success: Creating a Rails app with some defaults
To finish on a bigger success I had, I asked Copilot to create a new Rails app, using Rspec, FactoryBot, tailwindcss-rails, and some other defaults and it actually built it all exactly the way I would have liked, and it would have taken me 15-20 minutes adding gems and config files instead of <2 minutes for Copilot.
Success: Styling a form with Tailwind
It was actually really impressive to just say “Can you style this form using Tailwind to look nicer” and it did.
Summary
Its funny how using AI to program feels like I’m switching from programming with a keyboard to programming with a microphone. If it can be a pretty straightforward task, but it takes a lot of steps, using the AI saves a lot of time! However if it is something with a more recent technology than it might have been trained on I’ve had to tell the Agent to stop, undo and follow other instructions that I had to Googlestackoverflow myself. That is when I feel like talking to an AI requires more than just a “Vibe”.
Leave a Reply