Well, the ESPP is free money, so you should be doing it with your paycheck. The key is selling your purchases immediately.
Let's say that your plan gives you a 15% discount (they vary). Let's also assume negligible movement in the stock price between when you get it and when you sell it - you're exposed to some risk that the price goes down, but generally, stocks trend upward over time.
You get paid on Friday, buy $1000 in stock for $850, then sell it on Monday and get your check deposited to your account. You just got a 17.6% return on your money in a week. Transfer that into your checking account and spend it on your living expenses.
Where people get in trouble, is buying the company stock and holding on to it through a misguided sense of loyalty (actually, this is what ESPP's are designed to encourage). Then they end up dumping half of their retirement savings into one company's stock, the company goes out of business, and they're left with nothing for 30 years of service. So, don't hold it more than a quarter and you avoid most of the risk.