Help with RPM code

Why is a transistor needed? Couldn't the 10K resistor be in series with the photo-interrupter collector to 5V line and the emitter of the photo-interrupter tied to ground; the signal being read at the resistor-collector junction? - Scotty