I'm a pretty good distance guesser at short distances, in feet, and when I take my time. I use a technique that goes something like this, "Ok, I'm just under six feet tall, so if I were to fall flat on my face, where would my head end up. How many of those lengths are there between me and my subject?"
That works if the lens is stopped down, but one can do much better-
There are a variety of pocket rangefinders available, but they're either too modern for me, or too expensive. I found this in a 1941 Popular Science book, "How to Make Your Own Photographic Equipment". Construction is fairly obvious, and the key to the design is that it has to be built for your own particular eye spacing. That's why they were never mass produced. Calibration is with a tape measure. IMO, the accuracy should be quite good. It would fit in a large pocket & I thought it was sorta neat.
