let's first look at cartridge efficiency. Cartridges in the .223 class (short and burning around 30 grains of powder) tend to make most of their velocity in the first 18". .308 win type cartridges (~ 50 grains of powder) are best suited in 20-22" tubes. .30-06 class (55-65 grains of powder) make the most use of 24". larger magnums (burning 80-120 grains of powder) are happy in 26 or even 28" barrels. .50 BMG rifles (220-240 grain charge) need at least 28" and are most commonly found with 29-31" tubes.
So, for starters, the more powder you are burning, the longer the barrel needs to be. pretty simple. Of course, bullet weight and powder type are also major factors, but for the sake of this thread we'll stick to the simple stuff.
So, now consider that the less length a cartridge needs to develop velocity, the less it will be affected by adding or removing length. The .223 rem. does not have a tremendous change in velocity going from 16" to 24". my own tests with three rifles (one 16", one 18.5" and one 24") revealed that the spread from 16" to 24" with 55 gr. ball loads was less than 200 FPS. However, if one were to cut my .375 ultra from 26" to 18" I would expect a 400+ FPS velocity loss. I would also expect a gain of close to 200 FPS going up to 30". Why? That thing is using 103 grains of slow burning powder to push a very heavy bullet. My .308's showed an average gain of about 100 FPS from my 16" AR-10 carbine to my 18.5" G-3, which falls right in line with the common wisdom of roughly 50 FPS per inch.
In conclusion, ~50 FPS per inch is a good rule of thumb, but the only way to truly know is to test each load in rifles with different barrel lengths over a chronograph or, as a more practical approach, use a good ballistics program and enter all the variables. These programs are likely more accuracte than your loads will be consistent.