You often don't need a debounce if you read a switch in software. Hardware is so fast that it can see one push as a bunch of pushes, but software is generally a lot slower and you can use that to your advantage. In the example I gave above, the bit gets set as soon as the first contact is made. If the main loop reads the bit at that time, and then does something that takes 50 mSec, you can clear ButtonFlag at the end of that routine (rather than at the top). The switch will certainly have quit bouncing by then, so the bit won't get re-set by the bounce. This saves 50mSec of waiting.
If things really get "hairy", I do the debounce in ASM. I count the loops that the switch has been down (or up) and only generate a flag when that number of loops has been executed.
My programming style uses PAUSE sparingly, if at all. That is the only way you can get real performance out of a PIC and PBP.
Bookmarks