you can avoid them by not being a horrible person
Sometimes, measuring long-term effects might be an option, but that might also not help. I am still in favor of fighting for a good UX, but you should not categorize everybody as a horrible person who builds such crap (even though I want to too) ;-)