It is as you say, take a guess and then adjust if needed. Remembering these modern ferrules often take up a good distance in themselves.
Lines should be neat, and preferably with no double bend in them, they should enter the stop/barrel in-line, not at an angle. (often seen in rear mechs when people try to make it too short or don't cut it down)
Each to their own with the handlebar cables, I try to do it as they say above, but to be honest if shorter works better then I'll use that. I don't often ride my bike with the bars beyond 90degrees (or near that, but cables can start to pull before then if too short ...), so for me after that is doesn't matter if the brakes are pulled or the gears will change.
For some bikes it may well be a compromise and cables will need to use a different style of setup.