The author

Vibe coding: The Midas Touch

Steven Pemberton, CWI, Amsterdam

Contents

About Me

Alan Turing on UK £50 noteLast year was the 75th anniversary of Alan Turing's 1950 paper "Computing Machinery and Intelligence".

Turing is considered the father of AI. He starts the paper with

"I propose to consider the question, 'Can machines think?'",

and introduces what is now called the Turing Test of machine intelligence.

University

Richard GrimsdaleAt university my tutor was Richard Grimsdale, who built the first ever transistorised computer.

Grimsdale's tutor was Alan Turing (making me a grand-tutee of Turing).

Post-University

MU5I (coincidentally) went on to work in the department in Manchester where Turing worked and wrote that paper.

I worked on the 5th computer in the line of computers Turing also worked on, the MU5.

The Netherlands

A project meetingComing to Amsterdam, I co-designed the programming language that Python is based on.

I wrote part of GCC

Internet

Steven at a computer in the 80'sI was the first user of the open internet in Europe, in November 1988.

CWI set up the first European internet node (64Kbps!), and then two spin-offs to build the internet out in Europe and the Netherlands.

Web

Steven with Tim Berners-LeeI organised workshops at the first Web conference at CERN in 1994

I was chair of the HTML, XHTML, and XForms Working groups at W3C.

I co-designed HTML, CSS, XHTML, XForms, RDFa, and several others.

I still chair XForms and ixml.

Vibe coding

Vibe coding

Vibe coding is not really new: CEOs and managers have been vibe coding for years.

It's just the intelligence was natural rather than artificial (and slower)

Examples

In preparing for this talk I decided to use AI to write programs that I had written before, or to update older programs.

This was in order to compare its performance with mine.

But I also talked with several people who do vibe coding every day.

Is it any good?

Vibe coding is amazing for prototyping a program.

However, there are risks, that I will be describing.

An Example

Google removed a part of CSS that I have used for decades to present slides. So I vibe coded a program to make it look like it still worked:

I've got a number of XHTML files that represent slide decks for talks I give. The body of each XHTML file consists of a number of DIV elements: each DIV represents one slide. The head of the file contains a <link> to a CSS file.

I would like an XHTML+javascript file that asks for a URL for such a file, and then goes into full-screen mode and displays that file, one slide at a time, allowing me to step through the slides with arrow keys, and page up and page down keys.

(I had to go through 8 iterations to get it to what I wanted; I am using that program for this presentation)

English is not a programming language

The text above is programming code: the code necessary to create a working program.

The first thing to remark is that programming languages are designed to be exact and unambiguous.

English isn't.

Ambiguity

Same syntax, different meaning:

Safetly helmets must be worn on site Dogs must be carried on the escalator

Prompting is just like writing a standard

I have been involved in producing standards for decades:

You have to be very exact in your wording, no ambiguity or vagueness.

I found that vibe coding needed much the same style of wording.

Risk: LLMs have autistic tendencies

LLMs do exactly what you tell them to.

They may ask questions if they don't completely understand, but they will likely do just what you told them to, and guess when they have to fill in holes.

In one example it did exactly what was stated, and not what was intended.

We've all grown up listening to fairy tales, where a wish is granted exactly in the terms it was asked for, like King Midas who asks for everything he touches to turn to gold, but then he can't eat any more, and he turns his daughter to gold.

Be careful what you wish for.

Risk: Technical debt

Programming is not just coding: there is a whole lifecycle. The American Dept of Defense calculated that only 10% of the cost of a program was coding.

No one knows or understands the vibe code in its entirety. Maybe even how it works.

It is not documented except at a high level.

This is all potential technical debt: what will be available in the future to update or fix it.

Risk: Correctness

Now that you're not producing the code yourself, you are going to need to rigorously test your programs against what you are expecting them to do.

Testing is going to be a much needed skill.

It is possible to vibe code a set of tests, but this is the same entity producing the tests as produced the code.

Risk: Consistency

One correspondent reported that every time he asked an AI to make a change to a program, he had to run a diff to check that that was all that had changed.

This is because he noted a tendency for the AI to rewrite everything, even names of variables, making previous code reviews no longer valid.

Risk: Hallucinations

Hallucinations by AIs are well known, such as lawyers writing briefs that cite completely made up case law, and academic papers, where AIs make up fake citations.

This can also happen in code production, though the compiler and loader will spot many such mistakes.

Nevertheless, the result has to be checked line by line.

"GPT recommended I call a method I hadn't heard of in a library I'm using. So I googled it: 1 other result.

Turns out, it doesn't exist: GPT hallucinated it, but someone had asked about it on github... because an llm had hallucinated the same method name before."

Risk: Up-front Cost

At a typical cost of $25/million tokens, that is a reason for the AI owners to want to produce more tokens: you don't have much control.

As an example, a bank pays €180k/month for AI coding.

Risk: Security

You still have to check every line to make sure it's doing what you want.

And do you trust the owners of the AI not to insert tracking, or even malware? Do you trust the AI?

"The moral is obvious. You can't trust code that you did not totally create yourself." (Ken Thompson)

Risk: Quality

LLMs learn by reading everything on the internet.

From every program on the internet, from good programmers, bad programmers, even evil programmers, and in general average programmers. And from programs with bugs.

AI code is unlikely to be top quality.

Example:

A human-produced program: 900 lines of code.
Vibe coded: 2000 lines of code.

I later went back and looked at the original human-coded program, and recoded it myself: 350 lines of code.

Risk: Safety

Yesterday afternoon, an AI coding agent deleted our production database and all backups in a single API call.

It took 9 seconds.

The agent produced a written confession enumerating the specific safety rules it had violated.

Source

Risk: Privacy

Thousands of Vibe-Coded Apps Expose Corporate and Personal Data on the Open Web

Source

Risk: Copyright

US copyright only covers the output of humans, not machines.

Bad news for companies: if they use AI to build software, anyone can copy and use it for free.

Good news for programmers: to claim copyright, a human has to have done creative work, not just checked the output from the AI.

Ethical objections

There are complaints about

There are worries about

There are objections to AI being trained on data without permission.

Risk: The loss of ability

To check the output of AI, you have to understand what you are looking at. That is learned knowledge through experience.

When vibe coding you need to know what you are doing: AI is a helper, sometimes a really good one, and sometime a really bad one. You need to be able to tell the difference.

Conclusion

Be careful what you wish for.

Don't trust the results.

Test, test, test

Watch out for technical debt.