The book I'm reading, and also the digital pins page, suggest to use a pull-down (or pull-up) resistor for digital reads. I've read about this in most sites, and I can see it's kind of common practice. But I can't still understand why it is needed for my circuit:
I can understand that a common reference voltage would be needed if I wanted to read from an external circuit (for instance, the positive terminal of a battery), but here I'm using the +5V pin in the board as source, and the board's GND as ground, so when I push the button, if there were no resistor, the pin (which I guess uses the board's GND) should read +5V. In short, I can't understand why this case is a floating input.
Probably my confusion comes from the ignorance of how the circuit continues behind the pin.
I'm assuming the pin is somehow connected to ground. The specs says a pin can source/sink up to 40mA. Lets say I close the circuit, and from the +5V there's an incoming current (named I in the image). Now the voltage drop in the pull-down resistor is 5V, so the current (named I2) should be 0,5 mA. So I1, the current sinking in the pin, would be I - I2 (BTW, what is the max current the +5V pin can provide? In the specs page they say the 3.3V pin can draw a max of 50mA, but they don't say anything about +5V!). Anyway, let's assume from now that I is as much as the power source can provide, but the current I2 is in the worst case 40mA. Now the pin is in high impedance state, which is equivalent to a 100Mohm resistor between the pin and point A (according to the digital pins page in the official docs). So an incoming current of 40mA will cause a voltage drop of 4MV!