What is the best way to define an I/O pin? I read definitions like

const int ledPin = 9;


and also

#define ledPin 9


I know that a definition like

int ledPin = 9;


is a bad practice if you're not going to change it (which you usually won't), though I've see this several times in Arduino programs.
Which one of the other two is preferred?
#define ledPin 9 is preferred. By doing int ledPin = 9; you will be allocating an int memory whose value is used every time you use ledPin. #define is different in the sense it doesn't allocate memory. there is no memory called ledPin. Before compiling all "ledPin"s in the code(other than strings) are replaced by 9. So basically 

digitalWrite(ledPin);


becomes

digitalWrite(9);


Advantages of #define : Saves memory and since all ledPin are replaced by 9 before execution, it saves processor time. 
Doesn't really matter in small codes...