Buttons connected to Arduino – can they be dangerous?

Should you worry about destroying your Arduino just by an unsuitable code? Let’s see a simple example, the reading of the state of a button or switch.