I've read for the second time this morning that whenever we don't know which aperture would fit best, we should take something between f/8 and f/11.

Now my logic would dictate me to set an aperture of minimum value to ensure having the most part of my picture in focus (example : f/22 to f/32). This way, we could still create blur with a software where creating sharpness wouldn't be possible...

Of course, going that high would create a light problem but I don't get why this aperture get so much success... Is there an optical best ratio to use that aperture or is it just the best compromise ?