10k-ohm resistor in chapter 2 of arduino projects book

72mb:
So if I understand your solution is a software based pull-up or maybe use a resistor that exists inside the micro controller.

There's no such thing as a software based pullup.

The internal resistor is the way to do it except in very special circumstances (I can't even think of one right now).

72mb:
if we remove the 10k-ohm resistor and rather connect the wire to the ground, would it send "high" to the pin 2 or would it just shorcut the power to the ground?

It will short-circuit the power and bad things can happen - components can die, etc.

...and this is the reason that the internal resistor is preferred: There's almost no way to mess up and do bad things when you use the internal resistor and connect the pin to GND via a switch.