Basic encoding measures how many wheel slots pass the sensor. This will give speed and distance. By using two sensors slightly apart, you can also encode the direction. The following diagram shows how this would work:
The system on the left only encodes the speed. The wheel on the right encodes direction, with a sequence of 1, 2, 3, 4. The direction of the sequence indicates the direction of the wheel.
To build a robot with a record and replay type user interface, or a mouse/trackball, direction is important information, so the additional complexity and space needed ...