For months, if not years, many have warned of an imminent bubble in bonds. Yet one thing smart investors have learned is when so many people call for something to happen, it pays to be prepared just in case the exact opposite occurs.

The argument against holding bonds is itself a contrarian view. Investors have been putting hundreds of billions of dollars into bond funds in the past year and a half or so. In the ETF world, iShares Barclays Short Treasury ETF (NYSE: SHV) has seen some amazingly strong inflows since the market topped out in April. iShares iBoxx $Investment Grade ETF (NYSE: LQD) saw around $5 billion pour into the fund during the first 11 months of 2009.

The bubble dilemma
The argument against holding bonds right now makes a lot of intuitive sense. On the supply side, governments are issuing record amounts of new debt. So far, those big supplies have been met with amazingly large investor demand, due in part to the fact that despite the stock market's advance, many are nervous about the future of the recovery. In addition, U.S. Treasury bonds have benefited greatly from the flight away from European assets in light of the Greece-induced financial crisis there.

But those who buy bonds have to worry about more than just the next year or two. In the past, just as the Federal Reserve has cut rates as the economy goes into recession, it has usually raised rates once the recovery takes hold. Higher rates hurt those who own bonds, and thus those who believe the bond market is in a bubble foresee possible disaster for investors.

Looking at two bond markets
Yet that connection doesn't hold as solidly for long-term bond rates as you might think. During both of the last two recessions, in the early 1990s and in 2001, 10-year Treasury rates perked up only briefly before continuing their downward slope. Because long-term bonds reflect longer-term economic trends, they don't necessarily oscillate in the same way as short-term rates.

Another reason why bonds may not be doomed is the increasing fear of deflation. In Europe, some see deflation resulting from potential sovereign debt defaults, as such moves would essentially make money disappear from the financial system. Analysts point to 20 years of depressed asset prices in Japan, which has long dealt with the same high levels of debt relative to GDP that the rest of the world is starting to face.

In any event, fixed-income securities are an essential part of investors' portfolios, as they can help smooth downturns in stocks and the other assets investors hold. To minimize your risk from a bond implosion, consider these moves:

  • Own bank CDs instead of Treasuries. CDs don't just pay better rates than Treasuries right now, they also better protect you from rising rates. Consider: If rates on a five-year Treasury bond fund go up two percentage points, then you can expect to lose about 10% of your principal. But many banks will let you take early withdrawals from CDs just by giving up six to 12 months of interest. So if rates rise, you can just break the CD early, redeposit the funds in a better-yielding CD, and still possibly end up ahead.
  • Look at junk on the cusp. If a recovery leads to higher rates, then bonds generally will suffer. But on the flip side, it could make companies that are now only questionably creditworthy look much more secure. Sprint Nextel (NYSE: S), Continental Airlines (NYSE: CAL), and U.S. Steel (NYSE: X) all have bonds with BB-ratings, just below investment grade. If the economy boosts their prospects, and if they can then get investment-grade BBB ratings, then their bonds may see higher prices and lower yields even in a generally rising-rate environment. Similarly, junk bond ETF iShares iBoxx $High-Yield Corporate (NYSE: HYG), with almost 40% of its bonds rated BB, could benefit greatly from a faster economy.
  • Stick with new TIPS. Inflation-protected bonds can definitely help in an inflationary environment, but you might wonder what good they'd do with deflation. The answer is that direct-issued TIPS are guaranteed to give you at least their face value back, even if there's deflation over the period of the bond. That won't necessarily help with an ETF like iShares Barclays TIPS Bond (NYSE: TIP), however, so stick to newly issued TIPS.

The bond market does look scary right now. But as a way of diversifying your portfolio, holding some bonds makes sense. With the right kind of bond holdings, you'll make sure that even if the worst-case scenario happens, you won't see the damage others will from a bursting bubble.

What the heck happened last Friday? Fool contributor Morgan Housel has all the answers right here.