For a double, I like 28" as with no action length as on a pump or auto it doesn't hinder you and puts the muzzle blast just that little bit farther away. I don't like longer than 28", however, and would shoot a 26" without too much though.
For a pump or auto, I actually prefer 24" barrels, due to the action length adding to the overall length. I'd even like a 22" on an auto or pump, but muzzle blast starts to climb, so I opt for 24". My wife's 21" 20 gauge barks a good bit more from the shooter's perspective than my 26" Bobwhite did.
For range, with any barrels over 18", zero difference. Shotguns are short range, regardless, if there is a difference I can't tell as it would be on the order of a few yards or less.