>>3365230To add to the points made by my esteemed colleagues:
A theoretical perfect lens is sharpest wide open. The more compromises there are in the optical design, manufacturing techniques, and quality control, the further the lens diverges from that ideal, because wider apertures increase the effects of all of those optical problems.
So, typically a real-world lens will be less sharp at small apertures due to the unavoidable laws of physics, and less sharp at wide apertures because it's not a perfect lens. The optimum is therefore somewhere between those two extremes.
However, there's no hard and fast rule about where that sweet spot lies, and three stops from wide open sounds very conservative - like it was a rule thought up a while back, when lens technology was less advanced. High-end modern lenses are often sharpest wide open, or perhaps one stop down from there.
So the question really comes down to: how good is your lens? The better it is, the less you need to stop down if you want to get the best sharpness. In general: more expensive is better than cheaper; prime is better than zoom; smaller formats are more easy for manufacturers to make better, as are mirrorless lenses; faster maximum aperture often comes at a trade-off against optical quality.
So, a cheap 1960s f/1.4 lens is unlikely to be very sharp at all wide open, and might find its optimum around f/8, a full 5 stops from wide open; while an expensive modern aerial photography lens, based on an extremely complex optical formula and manufactured to outstanding tolerances, is sharpest when wide open at f/4.
One final point relates to depth of field. Your subject is not going to be sharp if it's not in focus, and the wider the aperture, the less leeway you're getting there. So if you shoot wide open on some super-lens that gets you most sharpness there, you're losing it if you're not focusing extremely carefully on a flat wall. Real subject may require you to stop down.