I suppose we should start with what you should not do. You should not leave them as digital inputs with nothing connected to them. This is because a digital input that happens to float some way between the supply lines will waste power in the digital input circuit. And wasting power is bad (ok it's not very bad in the sense that it won't catch fire, but if it is battery-powered, the battery will run out more quickly than otherwise).
So what might you do?
Program unused pins to be
- analog inputs
- digital inputs that you tie high or low externally directly (this was bad practice in the days of LS TTL because the input circuit was not designed to cope, and will quickly flatten the battery if you accidentally reprogram the pin as a digital output of the opposite polarity).
- digital inputs that you tie high or low externally via a resistor (costs an extra resistor)
- digital inputs with internal pull-up or pull-down resistor
- digital outputs either high or low
I like to have some pins as digital inputs with internal pull-up. This way the same code might detect it has been put on a different pcb or has extra hardware attached if that pin is sometimes externally tied to Vss.
And other spare pins as digital outputs, that I can monitor for debugging / status purposes. Maybe even hang an LED through a resistor off here on prototype boards.
It's your choice, and there's little to choose between the "good" options.
Hope this helps,
Danish