So before anything, I think it CAN be ok for exes to remain friends, but I also believe it's perfectly fine to have that as a deal breaker. I do not believe either side is better. Just different.
Now, if you are friends with and ex, or dating someone who is, I have one simple piece of advice.
Is this ex just like any other friend?
See, I think exes can be friends, but I believe it's naive to think you can just ignore that.
I say this as someone who IS friends with an ex.
Here's my golden rule for my friendship with her. She is my friend, not my girlfriend, and I will not treat her like my girlfriend. She doesn't get "special" treatment when compared to my other friends.
What do i mean by this? Well, for one, she's not my best friend, I have other friends who are closer to me than her. I vent to them, I joke with them, in a way I don't really do with her. That doesn't mean I don't do the same, but there's a clear difference in how close were are.
One buddy of mine treated an ex WAY TOO much like a gf. To the point where I didn't even see any difference between them dating or just being friends.
To put it simply, exes who are friends should be treated like FRIENDS.