Have had the SRH840 & M50.
I still have the M50. The SRH840 were unwearable. Their headband had no padding (you'll find it's a common complaint), they were big and bukly. The M50 are more compact and portable.
They isolate about the same amount.
The SRH840 is a bit more neutral through the mids, but lack the punch of the M50's. They are both very good with highs, and maybe the M50 edges the SRH840 out slightly, but some have complained that they (M50's) are strident or metalic in the extreme highs. I have never found them so.
Slight recess in the M50 mids, but it's never, never... ever been an issue for me.
There is no comparison in the bass. The SRH840 is lacking (by comparison only).
If the SRH840 sound came in the M50 format, It would have been a tough choice for me, but they were unwearable.
But the M50's are fun and will work their way into your ears, brain and heart.
Good luck.