Rotary Encoder - learn this if you have about 400 hours of time.

DavidOConnor:
Here is some great info on debouncing...
Debouncing Contacts and Switches

And the pivotal statement from that:

The undebounced switch must connect to a programmed I/O pin, never to an interrupt.

fungus:

DavidOConnor:
mechanical encoders need debounce.

No they don't. Quadrature encoding makes debouncing unnecessary, only one switch can be bouncing at any given time.

Not so sure about that - it has been pointed out to me that as many use wiping contacts, there can be noise on the contacts.