I serve my root beer at 40˚F and 25 psi through 35' of 3/16" ID beverage tubing to get a perfect pour and perfect level of carbonation. I know that 35' seems like a lot, but after much experimentation and glasses of foam this is what I have found to work the best. The 35' of tubing is neatly coiled up and zip tied in the back of my keg fridge.
The rule of thumb is 2 psi pressure drop per foot of 3/16" ID beverage tubing, but as the volume of CO2 is increased the effective pressure drop will be less than 2 psi/ft. At 3.5-4.0 volumes of CO2, the effective pressure drop per foot of 3/16" ID line is less than 1 psi/ft. Before I learned this fact I had 20' of tubing, but could not serve anything but foam at my desired level of carbonation. I did not want to compromise my desired carbonation level so I started with 40' but the pour was too slow. The carbonation was fine, there was no foaming but the pour was just too slow. I cut off 5' and found the sweet spot.
You can serve carbonated water at the same temperature/pressure with a much shorter length of tubing, but the sugar in the root beer will cause the CO2 to be knocked out of solution if you don't use a line length that is long enough.