In multiple courses, books, and jobs, I have seen text fields defined as VARCHAR(255) as kind of the default for \"shortish\" text. Is there any good reason that a length o
0000 0000 -> this is an 8-bit binary number. A digit represents a bit.
You count like so:
0000 0000 → (0)
0000 0001 → (1)
0000 0010 → (2)
0000 0011 → (3)
Each bit can be one of two values: on or off. The total highest number can be represented by multiplication:
2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 - 1 = 255
Or
2^8 - 1.
We subtract one because the first number is 0.
255 can hold quite a bit (no pun intended) of values.
As we use more bits the max value goes up exponentially. Therefore for many purposes, adding more bits is overkill.