A bicycle can be a pretty serious investment. That's why you hear lots of advice about getting used bikes, having a clunker bike to use for commuting, ways to "uglify" your bike to make it less attractive to thieves, etc. But I think there's one point that needs to be made: locking your bike with a strong lock or two is the best way to go.
There's a saying - if you and your friend are being chased by a bear, you don't need to be faster than the bear to get away: you only need to be faster than your friend. Horrible, I know, but it's true. And the same goes for bicycle security. You don't need to protect your bike from any possible thief... you only have to protect it better than the bike next to you is protected. A thief is under a time crunch with bikes - he has to get it before someone is on to him. So he's going to go for an easy target.
For that reason, I lock my bike up with TWO locks. I have a u-lock that keeps the bike attached to the bike rack, and I have a long cable lock that keeps the two wheels attached to the frame. That way, the bike is protected by two different kinds of lines of defense, and a thief has to be extra prepared to get my bike by having two different tools to get the locks open. Most thieves are going to look for easier pickings.
Here's a picture from one of my favorite commuting blogs, Paul Dorn's Bike Commute Tips Blog: it shows a bunch of different u-locks that have been dumped - obviously by a thief who was getting rid of the locks he'd opened in order to steal the bikes. Notice - they're all the same kind of lock! So this guy could get one kind of lock open but not multiple kinds. The harder it is to steal your bike, the less likely it'll get stolen.
Also, there are some ways to use your locks that make it harder for thieves to get at them and break them open, pick the locks, etc. Urban Bikers' Tips and Tricks, which I've mentioned before, has lots of great tips on how to use the various kinds of locks in this way.
So get a couple of locks of different types. Your bike will thank you, and so will your wallet. And... so will your sanity. If you've never had a bike stolen, consider yourself lucky - it's a frustrating and maddening experience.