When looking back at past performance (not always an indicator of future performance) the general consensus is to buy instead of mine.
However, for a few solid months this year, the opposite was true. If you had an investment in mining gear and could mine coins at a decent rate (when Ether jumped in price quickly, before the difficulty really spiked) you were actually making more Ether from mining than from buying.
I consider this time short time period an anomaly but still recommend both mining and buying. Mining more as a "hobby", to learn more about how Cryptocurrencies work, markets, exchanges community, fun etc. And buying some cryptocurrencies for longer term investments, or for trading if that's your thing. If you really want to get involved, obtaining the skills of learning a new programming language like Solidity will likely be a huge asset.
Right now, with the fluctuating price of Ether and the cost of building a decent mining rig, it's admittedly hard to see the forest for the trees. However, the fundamentals of Ethereum are still very strong even with the current ICO and scaling issues (problems that are being actively worked on) so I have little doubt the price will continue on an upwards trend over the rest of the year. This is mainly the reason I'm not selling any mining gear (or Ether).