AI writes bad code? Describe how it should behave

AI writes bad code? You just can't describe how it should behave. π
For seventy years we were drowning in a sea of unstructured code, and slowly we learned to structure it, so that it becomes predictable, maintainable, and behaves the way we want.
Now that AI writes 10K lines of code a day, what we're up against has drifted to "how to explain to AI what this code should do." So instead of a sea of unstructured code, we're falling into a sea of unstructured prompts, and over the next few years, we're simply forced to learn to structure it too. π
The main gap is that we never learned to describe HOW a system should work. Gherkin was built exactly for this, to describe behaviour, and somehow we never learned to use it properly.
Maps are a good way to see it.
Code always described the path: walk 3 km up, 2 km left, dig there and you'll hit the treasure. πΊοΈ Dropping a pin so everyone knows where to arrive is something we never managed in software.
From what I've researched, no single product fixes this, and we'll probably spend next years just learning to find the tools that structure this new ocean. My TrueBDD is one of them, probably: an open-source CLI where the behavioral spec becomes the source of truth and the code turns into an artifact you regenerate from it. A first step in this direction rather than the answer. π€
It's not the AI writing bad code, it's on us to explain to it how the system should actually behave.