A capacitor plus pull up resistor will add an RC time constant delay on switch release, and for it to be effective at denouncing it needs to be on the order of 10ms. A software solution has zero delay in both cases.
A Schmitt buffer isn’t necessary when using polled GPIO with a microcontroller.
An equivalent accurate discrete logic circuit would be a latching circuit with a gated input pulse on state change corresponding to the denounce time, which is overkill for simple button handling.