Turing Codex Turing Codex Introduction

Programming

Instructions precise enough for a machine to follow.

or Space to advance · Esc for an overview · ? for help

Programming

is…

Writing a precise set of instructions

that a computer executes to solve a problem.

Writing a precise set of instructions

Break it down

One hard problem → many small logical steps.

Move the data

Decide what is stored, and how it is transformed.

Control the flow

Choose which steps run, and when.

The machine does exactly what the list says

Play it, step it, or click any instruction to change it.

Computers don't speak English.

01000011 01010000 01010101

They speak in voltages: high or low. Nothing else.

Eight bits — as binary, hex, decimal and text

Flip any switch. Watch the brackets: four bits collapse into exactly one hex digit.

Why hex?

Binary

10001001 11111000
16 characters

Hexadecimal

0x89f8
4 characters, same value

Each hex digit stands for exactly 4 bits. Two digits = one byte.

CPU

CPU

The brain. It executes instructions, and it only understands machine code.

Two words before we start

Registers

A handful of storage slots inside the CPU. The fastest memory that exists.

Machine code

The instructions the hardware is physically built to perform. Pure binary.

Adding two numbers, in hardware

Fetch, decode, execute — three instructions, EDI = 5, ESI = 7.

The same thing, as assembly

Assembly is machine code with the bytes replaced by names you can read. One line, one instruction.

One instruction, three notations

movl %edi, %eax

assembly — what a human writes

One instruction, three notations

0x89f8

hexadecimal — the same bytes, compactly

One instruction, three notations

10001001 11111000

binary — what the CPU actually receives

Where does the data live?

Click a tier to fetch from it — the wait is proportional to the real thing.

Three lines of assembly

…are one line of Python

The whole function

A compiler or interpreter turns this back into the machine instructions from two slides ago.

So why not write assembly?

Tedious

One simple idea costs dozens of lines of register and address bookkeeping.

Error-prone

You manage the low-level details by hand, every time.

Not portable

It is tied to one processor architecture. Different CPU, full rewrite.

Compiler vs Interpreter

Compiler vs Interpreter

Compiler

Translates the entire source at once, producing an executable you run later.

Interpreter

Translates and executes line by line, on the fly, every run.

Watch the difference

Let it finish, then press run again.

The trade

CompiledInterpreted
SpeedFaster — optimised ahead of timeSlower — translation overhead every run
PortabilityPlatform-dependent; recompile per OSRuns anywhere the interpreter runs
DebuggingHarder — build, then runEasier — fails at the line it reached
ExamplesC, C++, C#, JavaPython, Ruby, JavaScript

Where you write it

An IDE puts the editor, the build tools and the debugger behind one window.

VS Code PyCharm Eclipse Visual Studio Xcode

Algorithm

Algorithm

Finite

It ends.

Well-defined

Every step is unambiguous.

Deterministic

Same input, same output.

A logical blueprint. It is not code — code is one way to write it down.

Pseudocode

Plain language plus a little structure. No language, no syntax rules.

…or written any other way

Both are correct. There is no standard — that is the point.

Same algorithm, two notations

Step through it, or drag edi / esi to change the inputs.

What this course is about

Decomposition

Breaking a hard problem into parts you can actually solve.

Thinking in steps

Designing algorithms, in pseudocode.

Not a language

Pseudocode implements into any language you like, later.

Try your pseudocode somewhere

Convert it to Python (any AI chatbot will help) and run it:

online-python.com onlinegdb.com

The second one supports many languages, if you'd rather not use Python.

Read the full article Variables & Data Types