robjh What you friend told you is essentially correct.
If we assume you want to go up the hills fast,
Long gradual hills = threshold work
Short sharp hills = VO2 max work
Both can be undertaken on the flat or on a turbo trainer. Ideally you would do a combination of both especially as you get faster and are spending less time ascending as no hills in the UK that I know of are long enough that you would have to ride them at threshold, there will always be a fairly large contribution of VO2 max.
If all you care about it getting up them, then an easy gear and good aerobic fitness will see you right. This again can be built on the flat or indoors!
Technique etc will play a part in the end game, as will the psychological aspect of knowing you can ride up hill, but ultimatelly, the engine is what gets you up hill and 95% of the effort should be on developing the engine and reducing excess weight.