Classes with the same name and description, but different location
That's a bad example, it is then used as another name to avoid a name conflict use Drupal\Component\Discovery\YamlDiscovery as ComponentYamlDiscovery;.

Usually you can see the purpose of the class when you look at the namespace or the corresponding file location. It's OK to use the same class name in different namespaces. As you can see in this issue there can be different opinions how descriptive class names should be and how much you should rely on the namespace of the class to make the purpose clear:

https://www.drupal.org/node/2408667