Everyone is right here.... but for different reasons, and commenting on different things.
Long gives high velocity so yes, "tends" to be more accurate at longer ranges, but it's a function of lack of drift and drop, as noted.
Shorter IS stiffer so barrel whip IS reduced and can contribute to accuracy. The jury is still out however if you are shooting at the same distance and the whip is "consistant", but that's really only practical in event specific competition rifles, not something where you'd be engaging at various distances. Barrel harmonics and whip are also affected by bullet "jump" which is why HP shooters experiment with distance off the lands when handloading non-magazine length for the 600 yard line. (Did cool work with this at a Jim Owens HP clinic last summer. We started at .010 off, and backed up .005 for each batch of 5. It was interesting how different rifles (all 20" Service rifles) prefered different jumps.
HP "Match" rifles DO have their front sights WAY out. Even past the end of the barrel on an extension to increase sight radius. Interesting though that the extension is "bored out" and not rifled so the bullet is passing through it clean at that point. Implies that there is no additional advantage after about 24".
Stiles is also right about about pressures and bullet exit. This is why some shoot 50 or 52 gr FLAT BASE rather than Boat Tail in Bench Rest competitions. I'm thinking of trying it for 100 yard reduced course ala Zediker. I'll let you know how the experiments turn out.
Stiles is also right about the M4 cuts in the barrel. That's why I don't use M4 cut barrels and do use FF handguards. Sling pressures or leaning on barricades will inevitably change POI.
Lastly, some think that a shorter barrel contributes to accuracy regarding follow-through. That is, the bullet is released from the barrel sooner, before movement will change it's path, between trigger pull and bullet exit. If that extra millisecond or two matters, you're either REAL GOOD or REAL BAD with your position hold.
Check out the .22 silhouette rifles used in Sportsman competitions by the likes of David Tubbs. VERY short barrels. He subscribes to the trigger pull to bullet exit theory.