Image for post
Image for post
By 銀糸 (Own work (本人撮影)) [Public domain], via Wikimedia Commons

The classical example of a program is Hello World. In Python this would be

print("Hello, World!")

It prints two words to the terminal. Not very inspiring.

If we wanted an actual simple example of computation, a better example might be to implement the Toffoli on three binary inputs a, b and c.

if a and b:
c = not c

This is the basic unit of computation. Any program can be compiled into repeated calls of this. It’s pretty much the only syntax you need in a programming language. Rather than bother with high level concepts like intor +, you could do it all with the endless Toffolis.

Of course, so sane person would want to. But doing all of computation in just two lines is a pretty nice first program.

So why do we just do the boring printing of an input that is Hello World? I would say that there is probably three main reasons.

  1. History. It is what we found our forebears doing.
  2. Relatability. The program is perfectly understandable in itself. Unlike the Toffoli, you don’t need a lecture in Boolean algebra to understand why you should care.
  3. Debugging. After a successful Hello World, we have a window into our programs. We know how to see if our program is doing what it should. It allows the program and programmer to talk to each other, and that conversation is where everything happens.

Which is the most important? Are there other reasons? These are questions I want to answer. Quantum computers are coming, and many programmers are already asking us what the quantum Hello World is. We need to find the right answer.

Find me on Twitter

Wrangler of qubits. Drinker of tea. Father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store