I bet there are many undergrads who would like to end up between WordPress "gluer" and JIT programming language author. (Personally, the thought of computer research seems extremely boring, so I'll let someone else have that fun). For these people, a degree in Math could be a good alternative to a CS degree. In my case, I had terrible CS professors but not enough money to move away to a better university. Luckily the Math program at my university is composed of excellent professors with extremely challenging content. Proofs have taught me how to think in different ways, greatly aiding my critical thinking abilities. Additionally, a degree in Math could help you become a more specialized programmer in an area such as finance or biology.
TL;DR If you're a CS undergrad thinking of dropping out, give your math department a chance.