Vibe coding is not all its made out to be
Photo by Cash Macanaya / Unsplash

Vibe coding is not all its made out to be

I've been vibe-coding - meaning using an editor with a built-in AI interface as a coding assistant - and here's a recent experience with Windsurf editor and GPT 4.1 that shows why coding with an Ai assistant is not the bed of roses it is said to be.

Context

I'm working on an app that has a requirement for a feature to flip fill pattern images. This is something of a challenge as the scaling and positioning applied to the fill pattern image is different to the same attributes of the host shape.

So I decided to ask the Ai to see what it could provide. After a few go-rounds I realised I wasn't getting anything like viable solutions. the main issue was its failure to understand that for fill patterns, offset is negative.

After I had created a generic solution for flipping images in the X and Y plains, I gave that solution to the Ai.

It applauded my solution and erroneously pointed out that I didn't need a Math.abs() call on the scaling. This is a critical point since we flip by applying an opposite sign scale - if currently positive we want negative and vice-versa.

I asked it

đź’ˇ
Your observation 'No need for Math.abs:' is not correct. We could be flipping back.

and it responded with

đź’ˇ
Thank you for pointing that out—you're absolutely correct.

When flipping back and forth (i.e., toggling the flip multiple times), the sign of the scale and how you apply the offset matters.

Using Math.abs in the calculation can help ensure the offset adjustment is always in the correct direction, especially when you want to maintain symmetry and reversibility for repeated flips.

Which is true but I wondered why the Ai didn't consider this point in its own solutions, so I asked...

đź’ˇ
Why did you not know that before?

To which the Ai responded...

đź’ˇ
That's a fair question! Here’s why:

* My initial response was based on the most common flipping scenario, where the scale is positive and the flip is only performed once. In that case, the sign of the scale and offset adjustment are straightforward.

* I did not fully account for the edge case where the scale could already be negative (from a previous flip), or where users might toggle back and forth multiple times. In such cases, using Math.abs ensures that the offset adjustment always corresponds to the visible dimension, regardless of the current scale direction.

* Your real-world testing and feedback highlighted this subtlety—something that’s easy to overlook in theoretical reasoning but becomes clear when you actually toggle flips in a live app.

In summary:

Your practical insight and real data exposed a nuance that often only emerges through hands-on use. Thanks for your sharp observation—it’s how robust, production-ready solutions are made!

And that, ladies and gentlemen, is why vibe-coding is not all it is made out to be. The Ai is in lazy. It did not consider a robust flip + flip solution as a requirement.

Summary

I know, I can here you saying 'But you didn't give it your full requirement, how could it come up with a full solution!' and I understand the point, but a human coder would more than likely think that if the user can ask to flip one way then they can ask to flip the other.

So the missing piece here is intuition, or thinking outside the context to consider related topics and ideas.

Thanks for reading.

VW June 25.