There aren’t many always-right or always-wrong rules in photography. You can find great photos where almost every rule, guideline or suggestion has been violated.
About the closest thing to an absolute rule is that strong, stark shadows nearly always make bad photographs.
Shadows are funny things. We can easily see them, but we also easily ignore them in our minds as we look at a scene. Outdoor photos taken in the open sun between mid-morning and mid-afternoon will often have strong, dark shadows that we did not notice when taking the picture. The problem is that strong shadows cannot be ignored in a photograph in the same way we disregard them when looking with our eyes.
It is nearly always a good idea to photograph outdoors when the sun is low in the sky (near dusk or dawn) or when the subject is not in direct sunlight. If you’re shooting friends or family, try to place them in the shade or wait for an overhead cloud to block the sun.
If you’re shooting landscapes or buildings or trees/plants/flowers, avoid the middle of the day. Low sunlight, shade or diffused light (clouds, for example) make a “softer” light that will give softer, more indistinct lines between the light and shadow in the photo. Sharp, well-defined light/shadow lines usually make ugly photos. However, a landscape photo in the desert at mid-day with strong shadows will look hotter, dryer and more stark than at dusk. It depends on what you want in the photo.
Here’s an example. On the left, there is a small lemon tree shot in direct sun. The shadows among the leaves and in the background are stark and distracting. On the right, the lemon tree was moved 5 feet back into open shade. The light is more diffuse (softer), and the shadow lines are very mild and almost gone. The photos were cropped to fit, but otherwise unmodified.
Another place where ugly shadow lines show up is in flash photography when the subject is close to a background. Professionals will rarely use flashes mounted on cameras because of the unflattering and shadow-prone light that they give. However, if an on-camera flash is what you have, move the subject 5 to 10 feet away from any walls, etc., to avoid having their flash shadow show up in the picture.
There are good shadows. Photos of people will often be more appealing with at least some shadow on the face. Continue to avoid strong shadows with sharp light/shadow lines, but allow soft shadows on a face, which will show texture, give somewhat of a 3D effect, and may contribute to a feeling of the subject having “character.” It is very difficult to do this with on-camera flashes – the pros will often use multiple flashes and reflectors, sometimes all around the subject, to manage the shadows the way they want.
And that’s really the point: shadows should not be things that happen to you, but should be things you manage in order to get the look you want. Most of the time, you will get more pleasing results taking photos in daylight (but under at least some shade) and avoiding the flash altogether.