BTW, I prefer NOT use "Interrupt" to achieve
To achieve what? Encoders are almost always read using interrupts, since you do not want to miss any pulses, even if you are busy doing something else (like waiting for a stepper to step).
because I will use this code as one subroutine in my loop, "Interrupt" may cause mess in loop.
Comparing the number of steps commanded and the number of steps achieved can be done in the subroutine, even though the number of steps achieved is counted in the ISR.
"Interrupt" may cause mess in loop.
Not if properly written. The clock ticks. That triggers an interrupt. Does that cause mess in loop()? Of course not. Serial data arrives. That causes an interrupt. Does that cause mess in loop()? Of course not.