im not saying your nuts or anything of the sort
the typical bullet of a rifle achieves maximum velocity in 22 (30 ODD 6 and similar rounds is what im referring to) that is typically the amount of length needed to burn the gas and propel the bullet, a longer barrel can be handy to keep accuracy higher, but typically the 22 is the minimum range you go to keep accuracy and velocity of a rifle , even a 24 is better in some cases to improve accuracy. now a sniper rifle usually has a long barrel to provide the maximum accuracy and range, but the gas loses its initial momentum and can lower the maximum velocity, but not hamper accuracy, this is a basic ballistic characteristic of a rifle bullet. its just a physics concept that has to do with barrel which is the length to travel from exit of muzzle, and the gas burn rate + amount of inertia placed upon bullet to achieve muzzle velocity. as gas burns it creates energy and applys a force ->, as it travels the gas burns itself out to a point were inertial energy transfer begins to drop. this 22 idea was thought up during the war originally i believe, when extensive test showed rifles of length 22 could still reach the max velocity(look at old war rifles lengths if youd like) so for close combat and weigth loss, the 22 length was easier to use and maneuver with while in combat, unlike a long barreled rifle such as my 91/30 which were typicaly used as sniper long range rifles.
basically its determined by what funtion youd like the rifle to achieve
close combat/ tacticle use that can retain long range capabilities
long range and highly accurate at the loss of mobility and inertia