Ive done MDMA and had nothing but good experiences with it. People ruin their brains and kill themselves when they don't know what they're doing. MDMA if taken in large doses 300mg+ is neurotoxic and this is what impairs your cognitive abilities (perhaps for the long term!) People also use it too often and in high doses which doesn't give the brain enough time to replenish itself. Alexander Shulgen the father of recreational MDMA use advises to wait 3 months between use, as the drug is serotogenic which means it needs serotonin in the brain for the effects to work. Your brain - unfortunately doesn't have an unlimited supply of serotonin therefore you need to wait for your brain to replenish its stocks (this is why people feel depressed a few days after use due to a lack of serotonin) and if you take this drug within the 'healing' time this is where you damage your axons and leads to increased unwanted effects i.e memory loss etc.
People also die on MDMA because of water consumption. They either don't drink enough and get dehydrated and die from seizures etc, or on the flipside, they drink too much and get water poisoning which is resulted from salts being dilated in the blood which causes the brain to swell against the cranium and people get seizures this way. The guideline amount of water consumption is 500-600ml an hour if dancing and take small sips not to gulp.
Furthermore, people die on MDMA or 'ecstacy' pills because they don't test their pills and usually there are fillers in the pill which when mixed can cause bad symptoms or even death. You can by marquis agents online for really cheap and you can ensure what you're taking is actually MDMA. You cannot overdose or die from the compound MDMA on it's own which is another misconception. It's other fillers such as piperzines that cause death.
I'm not trying to encourage MDMA use but it's people who don't do their research and take the drug in unsafe (excuse the irony) ways which cause the drug to get a bad name.
I'm trying to spread awareness and hope that if people do choose to take this common drug that they will do so in a sensible way.