If you somehow don't have horses, you probably shouldn't build a stable. Beyond that, it depends. I like using a mix, partly because of how units leap frog each other in strength. Like I said about horses, you need iron for knights, niter for muskets. So it depends on what you end up with for resources as well. The biggest difference though is in the promotion trees. Melee units can get +10 when fighting in a district, making them better at taking cities if you can park them in a district. Cavalry units don't have any promotions that can help with city attacks and they have innate weaknesses to anti-cavalry, which melee units do not have. All in all, I don't think anyone should write off melee units as worthless, as it all depends on the situation.