digitalRead statement issue

You will see very old Arduino code where they do sometimes write HIGH to an input. This turns on the pullup resistor built into the input circuit. The modern method is to use pinMode(pin_name, INPUT_PULLUP);