← Machine Coding

Build to Find Out

When building is cheap, the built thing becomes the fastest way to discover what you want.

The previous chapter ended with three words: build to find out. This chapter explains what they mean, and then asks you to do it.

When building becomes cheap enough, the built thing stops being merely the end of the process and becomes an instrument of thought. Instead of having to decide exactly what you want before you build it, you can build several possibilities and discover what you want by using them.

That sounds like a small change in sequence. It is a large change in how software comes into existence.

Specification was the price of expensive building

For much of the history of software, the economics favoured a familiar order: decide, then build. If a version took three months, building the wrong one was an expensive mistake. So we argued, wrote requirements, drew diagrams, reviewed documents and held sign-off meetings — all attempts to predict what a thing would be like once it existed.

That ceremony was insurance, and the insurance was rational. But it had a limitation. Anyone who has delivered a carefully specified system and watched its first real users has seen the gap between what the document promised and what the experience turned out to be. Even a good specification cannot tell us everything about the experience of using a product. Some things have to be experienced to be understood.

Chapter 12 described the threshold at which doing something yourself stops being worth it. Prototyping is crossing a similar threshold. When a playable or usable version costs an afternoon rather than months, the old order can invert. For questions about the experience itself, building may be cheaper than another meeting and more revealing than another document.

A prototype is a question

Chapter 04 distinguished building to learn from building to finish. Cheap implementation changes the balance between the two. A prototype need no longer be a reluctant preliminary to the real work. It can become the way you think through a problem. Rather than waiting for an answer to form in your head, ask the machine to give you something you can experience.

A description of a game says it should be fast and challenging. Thirty seconds of play begins to tell you whether it is. A description of an interface says it should be simple. One attempt to use it reveals where you hesitate, what you ignore and which button you keep looking for. Feel, pacing, confusion, delight: these are properties of experience. A description can anticipate them; a prototype lets you encounter them.

So I have come to treat a prototype as a question asked in the language of experience. Is this idea any good? Which direction feels right? What happens when someone actually tries to do the thing? The machine builds the question; using what it built begins to reveal the answer.

One idea branches into three small deliberately different prototypes; observations select one direction to keep while the rest are discarded as experiments.
A prototype is a question. Build several small, deliberately different versions, compare experiences, keep one. The valuable output is knowledge — not necessarily reusable code.

Build more than one

The deeper change is that you no longer have to choose between ideas before you have seen them.

When you could afford only one implementation, you had to compare possibilities largely through argument. Now you can ask for three versions of a game in different moods, or three versions of a screen organised in different ways. Instead of debating which might be better, you can try each and discover why you prefer one.

There is a skill to this. Machines tend to converge, as Chapter 04 described: ask for three versions and you may receive one idea in three colours. Ask instead for versions that are deliberately different — in mood, in how they play, in what they assume the user wants. Keep each one small, because its job is to answer a question, not to be finished. And keep the question narrow: not “which of these is complete?” but “which of these is worth continuing?”

Divergence is becoming cheap. Convergence remains your responsibility. The machine can produce alternatives faster than you can evaluate them, so your attention becomes the scarce resource. I usually start with three. Ten can easily become a way of avoiding a decision.

Throw it away

Hand-written code carried a moral weight it did not deserve. Because it had cost us days, we kept it — patched it, defended it, built on it long after we knew it was the wrong foundation. The cost of having written it disguised itself as a reason to keep it.

A small machine-built prototype can be inexpensive enough to discard without ceremony. If you build three versions and keep one, you have not necessarily wasted two. You have bought two answers. Their value lies in what they taught you, not in whether their code survives.

What survives is the lesson. A line in the project’s README or Intent Record — tried a slower, calmer version; it felt like a screensaver; abandoned — may save the next session from repeating the experiment. Keep the knowledge even when you discard the implementation.

Cheap is not free. Each version consumes time, tokens and, above all, your attention. Build to find out has a stopping rule: stop when you know enough to choose, even if the choice is to abandon the idea. And when you decide to build on a prototype, assess whether its implementation deserves to become a foundation or should be rebuilt. The earlier disciplines of foundations, packages, process and evidence still apply. Building to find out is the front of the loop, not a replacement for it.

A note for experienced programmers

The exercise that follows assumes no programming knowledge. If you are an experienced developer, do it anyway, with one additional rule: do not open the code. Not once.

When something is wrong, describe what you see on the screen, not what you suspect is happening in the source. When you are curious how something works, ask the machine to explain it rather than reading it yourself. It will feel like working with one hand tied behind your back. That feeling is the old interface reasserting itself — the reflex Chapter 12 described, of treating the code as the place where the real work lives.

Notice how often you reach for it. That observation is part of the exercise.

Try Machine Coding: Build Neon Defender

Your challenge: create a real, playable arcade game, try several versions of it, keep the one you prefer, save it on GitHub and publish it on the web — without writing the code yourself.

The game is Neon Defender. A little spaceship flies across a starfield, fires glowing shots, dodges falling obstacles and earns points. There are explosions, a high score and a restart button. It is visually satisfying and technically simple: plain HTML, CSS and JavaScript running in a browser, with no database, no paid service, no package manager and no game engine. That simplicity is deliberate. Your first experience of machine coding should be about the game, not about the setup.

What you need: a GitHub account and an AI coding assistant that can create and edit files in a repository, either directly or through an authorised coding environment. Try speaking rather than typing: I find it helps me describe outcomes instead of composing implementation instructions. If your assistant does not support voice, type naturally. Nothing in the exercise depends on a particular product. You can also begin with a downloadable HTML file and publish it later.

The prompts below are starting points, not prescriptions. Change them. Say things differently. Each checkpoint describes what you should establish for yourself; this is a practical exercise, not a report of a completed session.

Step 1 — Create your project on GitHub

Open GitHub’s new repository page. This exercise creates a public project: do not include private material, passwords or API keys. Create the repository with these settings:

  • Repository name: neon-defender
  • Visibility: Public
  • Add a README file: Yes
  • Description: My first voice-built arcade game

Choose Create repository. Initialising it with a README gives you a starting branch and a home for the application. You have not written any program code.

Step 2 — Tell the machine what to create

Open your assistant, connect it to GitHub if necessary, and grant only the access needed to work on this new repository. If it cannot write directly to GitHub, use the local-file alternative below. Then say:

I have a GitHub repository called neon-defender. I want you to build me a complete arcade game called Neon Defender.

It’s a colourful space game. I control a little spaceship at the bottom of the screen. Obstacles fall from above, my spaceship fires automatically, and I score points by destroying them. I lose a life when an obstacle hits my spaceship.

I want to move using the mouse, arrow keys or touch on a phone. Give me three lives, a score, a high score, a start screen and a game-over screen with a restart button.

Make it look modern and impressive, with glowing colours and smooth animation.

Use ordinary HTML, CSS and JavaScript. Don’t use any frameworks, external services or paid APIs.

Create the files directly in my GitHub repository, commit the implementation, and tell me exactly what you created. Don’t claim to have tested anything you couldn’t run.

Checkpoint: your repository contains an index.html file and whatever JavaScript and CSS the game needs.

If the repository connection defeats you, do not copy hundreds of lines of generated code by hand. Ask for the whole game as a single index.html file you can save and open in your browser. You can complete the play and exploration steps locally, asking for separate downloadable versions, then return to publishing when the connection is sorted out.

Step 3 — Put your game on the internet

Say:

I want to play my game in a browser. Please help me publish this repository using GitHub Pages. If you can configure it with my permission, do so. Otherwise guide me through the necessary GitHub settings. Then give me the public address and check whether the page loads.

If you need to do it yourself: open the repository on GitHub, choose Settings → Pages, and under Build and deployment choose Deploy from a branch. Select main, then /(root), and save. When deployment finishes, the Pages settings show your site’s address.

Checkpoint: a public web page plays your game.

Step 4 — Actually play it

Open the game, published or local. Move the spaceship, watch it fire, lose a life, reach game over and restart. Notice anything that feels wrong, and describe it to the assistant. Then say:

I’ve played the game. Now inspect it and check whether everything works.

Check movement, shooting, collisions, scoring, losing lives, game over, restarting and the saved high score.

Check the desktop experience and the mobile experience wherever your tools allow.

Correct any bugs you can establish. Don’t add new features yet. Commit the corrections and tell me what you tested and what still needs checking.

Checkpoint: you can play a complete round, lose, restart and play again.

Step 5 — Build three, keep one

This is the heart of the exercise and of the chapter. You have a game. Now find out what game it should be.

I want to find out what this game should become. First ask me a few questions about the kind of game I’d enjoy and what I want players to feel.

Then build three quick versions that are deliberately different — in mood and in how the game plays, not just in colour. Keep each small, with its own index.html in a separate folder. Give me the address or file for each version so I can play them separately. Don’t change the original. Keep any saved scores separate between versions.

Don’t polish them. I only need enough of each to play it for a minute.

Answer its questions honestly. Then play each version — properly, for a minute or two each. Say out loud what you notice: which one you wanted to keep playing, which one bored you, which one surprised you. You might find an underwater version, a calm asteroid-drifting version, a frantic one, a children’s one, or something you would never have thought to ask for.

Then choose. You may pick one outright, combine the best of two, or reject all three and explain what you have learned. If you choose one, tell the machine why, in your own words. For example:

I’ve chosen the second version, because it feels tense without being frantic. Make it the main game. Keep the other versions in the repository as experiments, and add a short note to the README recording what each version tried and why I chose this one.

Checkpoint: you have played three deliberately different prototypes and made a decision based on experience rather than description. If none is worth continuing, use what you learned to direct a new small experiment before moving on.

Step 6 — Make it impressive

Only now is it worth investing in polish. Say:

Now make the version I chose feel like a polished arcade game.

Improve the graphics, add attractive particle explosions, give the spaceship some personality, make the enemies visually interesting and create a beautiful title screen.

Make the game feel smooth and responsive. Add optional sound effects with a mute control, keeping sound off until the player enables it.

Keep the game simple and easy to play. Don’t introduce a complicated menu system or unnecessary features.

Make the improvements, test what you can, and update my GitHub repository.

Then play it again. If the polish has buried what you liked about the version you chose, say so — Chapter 11’s warning about slop applies to games too.

Checkpoint: the game looks and feels substantially better, and it is still recognisably the game you chose.

Step 7 — Finish and share

I want to finish this version of my game.

Check that the main game works, including all its original controls and rules, that restart works, that the high score survives a refresh in the same browser, and that the published page loads after the latest deployment.

Update the README so someone who discovers the repository knows what the game is and how to play it.

Make sure the final changes are committed. Give me the live website link and the repository link.

Explain any limitations honestly, and don’t claim success for checks that haven’t been performed.

Open the game one last time and play it.

How you know it worked

Success is not that the machine produced code. It is this list, checked by you:

  • The game loads from a public web address.
  • You can move the spaceship, destroy obstacles and score.
  • Lives, game over and restart work.
  • The high score survives a page refresh in the same browser.
  • Desktop controls work, and touch controls have been tried on a phone.
  • The source code and README are saved on GitHub.
  • You built at least three versions, played them, and chose deliberately.
  • You made at least one creative decision that is genuinely yours.

The published game is public, so it must contain no passwords, API keys or private data. GitHub Pages serves static files; it provides no private backend or database, which is exactly why this game was designed not to need one.

What you just did

If you completed the exercise, you have practised the method of this book in miniature.

You communicated an idea, experienced what the machine built and directed corrections. Then you explored three alternatives, played them and chose with evidence from your own experience. Instead of spending the bulk of your effort making the first idea presentable, you discovered which idea deserved that effort.

You did not need to learn JavaScript, install a development environment or write the code yourself. Yet you made the creative decisions that gave the game its direction.

The prompts were mine, but only to get you started. The important thing is not whether you built my game exactly as described. It is that you discovered how to create software by communicating an intention — and how much more clearly you can see that intention once you have something to use.

Once you have discovered that, stop building my ideas and start building yours.

What comes next

Here the machine was primarily a builder, giving you possibilities to experience and judge. But it can also help with the thinking itself: understanding a problem, investigating what is known, imagining directions you would not have reached alone and challenging your judgement of the result. That is the subject of the next chapter, Think With the Machine.