Chapter Two · Representing Information

Representing Information

Computing Foundations taught that everything is bits and that meaning comes from an agreed code. This chapter goes one layer down and prices the agreements, in six topics: interpretation itself, fixed-width integers, floating point, text, how structured data travels between machines, and how much information data really holds.

6 topics

Every value a program handles is a pattern of bits plus an agreement about how to read it. The integer agreement is fast and exact until a result does not fit, and then it wraps without a word. The floating-point agreement covers an enormous range and gives up exactness to do it. The text agreement assigns a number to every character in every script and then writes those numbers in bytes of varying width. None of these agreements is stored with the data.

So the failures in this chapter share one shape. Nothing crashes. A counter wraps to a negative number, a sum drifts by a fraction of a cent, a title fails to match its own search, a number written on one machine is read backwards on another. The bytes are intact and every reader does its job, and the value is wrong.

Each topic shows the picture behind one agreement, puts numbers on what it costs, and ends where the cost lands: in a database column, a JSON payload, a search index or a compressed log. The last topic asks how small any of it can be made, and why some data cannot be made smaller by anyone.

Three agreements every program relies on
Integers
Exact within a fixed range. Past it, the value wraps round silently.
Floating point
An enormous range in 64 bits. The price is that most decimals are stored approximately.
Text
A number for every character, written as 1 to 4 bytes. Four different answers to "how long".

Topics in This Chapter