Title really says it all. I realize that if the barrel is too short then the bullet leaves the barrel while the gas is still expanding, but how long is too long? I mean say the gas expands 20 inches (of a 24 inch barrel) down the barrel till it equals the external pressure. Why would be 24 inches be better than say 22, or 26 for example. What I'm really asking is how would you calculate optimum barrel length to maximize the bullet distance.