If I'm getting the question correctly, it is about whether at infinity focus you ought to use wider apertures like f/1.4 or narrower apertures like f/11 to get the sharpest results? The answer is, it depends... First let's look at what depth of field actually is at infinity focus.
The depth of field depends on three things:
- Focus distance,
- focal length,
- aperture (the f-number) and
- sensor or film frame size.
Focus distance is the distance between your camera (specifically the sensor or film) and the subject you are focusing on. That's usually expressed in feet or meters. Focal length is the distance between sensor/film and the convergence point of light in the lens. It's usually expressed in millimeters (50 mm prime lens, 28-135 mm zoom lens...) and determines the field of view. The f-number is the ratio of the focal length to the apparent diameter of the aperture iris as seen through the lens' front element. Usually you see this expressed as the inverse of that with "f/" in front. A 50 mm lens with an apparent iris diameter of 10 mm would have an f-number of 5 (50 mm / 10 mm), usually denoted as f/5. The same 50 mm lens with its iris open to 25 mm as seen from the front would have f-number 2, denoted as f/2.
Depth of field decreases with wider apertures. For a given focal length and focus distance you get a shallower depth of field at f/2 than you would at f/8. Depth of field decreases with greater focal length. For a given focus distance and f-number, a 50 mm focal length would give a greater depth of field than a 100 mm focal length. Depth of field increases with focus distance. For a given f-number and focal length, focusing on a subject at 20 meters away gives you a greater depth of field than a subject at 10 meters away. Details about why this is can be found on this site and many other resources. This is all due to how lenses and projections work, combined with physical limitations of materials like sensors and film.
The sharpest focus will be anything in the field of view at the focus distance. So if you focus your lens for 3 meters away, things at 3 meters will be sharpest regardless of focal length or aperture. In front of that imaginary spatial plane (between camera and focus distance) is an area of acceptably sharp focus, and also behind (between focus distance and infinity). The sum of those two distances is the depth of field. Important to know is that the "sharp" area between camera and subject is shallower than that behind the subject. Let's look at some examples. I'll be using an online DOF simulator. In case that link goes offline, you can easily find many more, or download an application for desktop or mobile devices.
Imagine we're shooting with a 50 mm prime lens. The subject is at 3 meters distance and we correctly focus. The aperture is set at f/3.2. The camera has a full-frame sensor (or 35 mm film). The total depth of field then comes out to 66.5 cm. 29.6 cm of that range is in front of the subject, 36.9 cm is behind the subject.
Move the subject to 5 meters and focus correctly, and you get a 190 cm depth of field of which 77.6 cm is in front and 113 cm behind.
Keep focusing further away and the depth of field will increase. The depth of field behind the subject will also increase at a greater pace than in front. With a 50 mm lens and f/3.2 focused at 20 meters, the depth of field becomes 65.59 m with 8.51 m in front of the subject but a big 57.08 m behind the subject.
At some point the part of the depth of field behind the subject becomes essentially infinite, even before you focused at infinity. This is known as the hyperfocal distance. For a 50 mm focal length at f/3.2 the hyperfocal distance is 26.94 m. This means that if you focus your lens at that distance or further, you're guaranteed that the "acceptable sharpness" stretches on to infinity behind the subject. You still get a good deal of depth of field in front of the subject too, but not all the way to the camera.
Hyperfocal distance is very useful for certain types of photography. For example in landscapes, if you know the hyperfocal distance for your chosen focal length and aperture then if the subject you focus on is at least that distance away, you know for sure that you're also getting everything behind it (like mountains, distance clouds, stars...) in focus.
When you focus to infinity the depth of view stretches from the hyperfocal distance to infinity. So that's a second useful aspect. Focusing to infinity and knowing the hyperfocal distance tells you how close something can get to you before it starts getting out of focus.
So that brings us to your question. If you are shooting things that are far enough away so that you need to focus to infinity or at least very close to that setting, you shouldn't need to worry about a wide aperture causing you to miss focus. Even with a 200 mm lens at f/1.8 (if such a thing exists) the hyperfocal distance on a full-frame sensor would be about 775 meters. Focus for infinity and everything further than 775 meters will be sharp. Focus at 775 meters and you'll get a depth of field from 387.3 meters away to infinity.
Assuming things are as far away as you think and you manage to focus at least to the hyperfocal distance you won't get pictures lacking sharpness due to a "too shallow" depth of field. So what could still cause you to get pictures that aren't as sharp as they should be?
First there's of course equipment. Quality lenses and a camera with a good sensor (or high quality film if you go analog) will tend to yield better results.
Assuming that's at acceptable levels you'll need to be able to keep the camera stable. Hand-held shots will seldom manage to be sharp at longer shutter times, especially as the focal length becomes longer. With a 50 mm lens and no other stabilization tech any shot with a shutter speed slower than 1/50 second is a gamble. If the camera is stable (on a solid tripod, not in anything heavier than a breeze) you can increase sharpness by using a remote to fire the shutter and using the lens lockup feature if the camera has it.
Narrower apertures lead to longer shutter times because you get less light onto the sensor/film. That is detrimental for hand-held shots. This might be why you found better results at f/1.4 than at f/8. But even if your camera is mounted on a tripod longer shutter times might reduce sharpness through motion blur. This could be due to vibrations from the mirror and/or shutter (more pronounced at specific speeds), slight movement due to wind or simply the scenery moving. When shooting stars or the moon it's easy to underestimate the rate at which the night sky changes. An exposure of even a few seconds would be enough to have stars start to streak and wash out details on the moon. So a narrow aperture might simply not leave a short enough shutter time to get a sharp shot. When it does you might have to crank up the ISO so much on a digital camera that a lot of noise is introduced.
But always going for the widest aperture isn't necessarily the best choice. Again due to the physics behind lens design, the sharpest area of the projection will be at the center if the image with the quality diminishing towards the edges and corners. That's where distortion, chromatic aberration and blur start to play a bigger role. Lenses tend to have a sweet spot in their aperture range where this is minimized. Typical numbers are f/5.6 and f/8. There's a point of diminishing returns in narrowing the aperture. At values like f/16 and higher you might start losing sharpness again due to diffraction. You can usually find information about which apertures a lens performs best at, make an educated guess or experiment to find out.
So in the end you need to consider things in this order if you want to shoot things at long distance.
- What's the subject? Is it only things in the distance or are there foreground elements you want sharp? Compose to find the suitable focal length.
- Take the closest thing that needs to be sharp and estimate the distance (or use assistance like auto-focus and a read-out of the resulting focus distance). Find the widest aperture you can use to focus on that thing and still have the DOF extend to infinity behind it, or focus behind it and still have it in the DOF before the focal plane. If it's further than the hyperfocal distance you can just focus at infinity.
- Now find out the proper shutter time at that aperture and for the given lighting conditions. If it's fast enough that you can narrow the aperture a bit more and sacrifice some shutter speed, do so if a narrower aperture puts you closer to the ideal value for sharpness.
For a digital camera you also want to take into account that you wish to keep the ISO as low as possible to reduce noise in the image.