Comparison is akin to the gladius, the double-edged sword of Ancient Roman infantry: we compare ourselves to others to feel better by enlarging our accomplishments, but also to make our pain seem more tolerable.
Not questioning its use, it is still worth reflecting on its usefulness in the here and now. I lean towards answering in the negative, even if this might remove the occasionally desired emergency brake from our emotional roller coasters. Thus, anxiety can easily emerge if we single out an aspect of our personalities since there is always someone better than us.
If we want to become the architects of our own fate, then this edge of comparison is to be handled with care: there is a fine line between drawing motivation or despair from someone else's success. However, we cannot change the past; we can only learn from it via careful self-reflection. As Seneca wrote, choose yourself a Cato, whose qualities you can aspire to reach and who can guide you in your actions. However, Seneca did not suggest this practice to measure our achievements.
With respect to which, there are always confounders; i.e., we cannot fathom the opportunities the subject of our comparison got. If, due to reasons outside your control, you could not study at an elite university, but the other person could, then though you could exert the same effort, you will not get the same options. Externals, as Seneca would say.
By
compare forward, but not backward,
I mean that though inspiration from the past can be handy, we should not ruminate on opportunities gone or nonexistent. Comparison better be directed towards the future we can shape, where we can ask ourselves what we can learn from others and how we can create opportunities for ourselves.
I must acknowledge that sometimes comparison can be an emotional fuse that grinds our anxiety to a halt. If we are about to hit rock bottom, then seeing that others do worse can make us feel better in the short run. Though this should not be our mental haven: since it is generally not the end of the world, and there is an upside of stress. By acknowledging the pain and discomfort, we can grow from it.
So comparison is like a gladius and not just by having two edges: as a sword cannot only be used in war, comparison is also not something I would abandon altogether. But if this is your medicine to be relieved or if this indeed inflicts pain, use it with moderation; it might leave scars in the end.
Resources
The Upside of Stress by Kelly McGonigal