Just a button in between without any resistor. Is that really safe? Won't that damage the board in the long run?
Not really a matter of safety. A digital input pin is a very high input resistance and can only be damaged by applying voltages over +5vdc or any negitive voltage. The problem with wiring a +5vdc switched voltage to a input pin is that the pin will read noise and invalid logic levels when floating when the switch is not being pushed.
A external pull-down resistor for the pin would work fine without modifying the code, or as already posted using the pin's internal pull-up would work fine if you modify the code for a active low switch input.
Lefty