The more I look to GenAI to save me minutes, short periods of time, the better it works. Here’s an example of something I do regularly where AI helps.
This is part of a series of experiments with AI systems.
Reformatting code
I often see code like this submitted in articles.
The code conversion box often adds extra lines between code. It’s a strange error, and since things get pasted in with lots of formatting, it’s not so simple to fix. I often look at the code side of things and remove lines. This is the raw code:
It’s ugly, and it’s easy to fix, but it takes time and it can be an annoying task. I often might put on a video or multi-task while I handle this simple reformat.
Using Claude
Claude is often my go-to GenAI for now. I tried this prompt, with a CTRL+V of the code. As you can see, Claude starts to reason things out.
On the right side, I can see it rewriting code, which is always fascinating. Reminds me of terminal work over a 300baud modem in university. I’ve grabbed a short snippet of how this works.
Once this is done, I see my code on the right code. I can click “Copy” at the top and then paste back into the editor. It looks much better.
This allows me to move on and tackle some other task before I come back to this, knowing Claude will have helped me.
Small wins, very helpful, but a lever to make me more productive.
I don’t know if this is worth the cost in computing, but it is very helpful. Minutes saved are likely worth a small subscription to the tool every month if I can find a few more tasks like this.