Facebook is usually not what you want your employees browsing at work. But if your developers just happen to be perusing the popular social networking site, don’t freak out just yet. They may be browsing through the various open-source tools produced by the company, or possibly reading up on some of the new APIs and SDKs released by Facebook at its annual developers conference, known as f8, this week.

We popped into the show to take a look at some of the new ideas and technologies offered by the platform. That being said, some of the most interesting tools at Facebook aren’t new, and aren’t even targeted at their own platform. After all, with millions of users online every second, Facebook has some very difficult software problems to solve. Thankfully, they’ve shared many of those tools with the rest of the world. Here, then, are the top five cool tools produced by Facebook.

There’s really no other way to say it: Giant refactoring projects are really tough to get your arms around. Either you sit in front of your IDE for hours going over every single change to make sure nothing bad happens, or you automate the process and come back in the morning to find every single solitary test has failed and the code is no longer meeting requirements.

Facebook obviously had this problem. To fix it, they wrote casemod, a simple little tool and library that makes refactoring less painful. Instead of completely automating the process, casemod allows developers to straddle the line: They can run refactorings with exceptions that will trigger human response. Thus, you aren’t tied to a machine approving every single change, but you can still make sure that sensitive areas of code aren’t gone over with a robotic lawn mower. When something sticky comes up, casemod will let you know so you can handle the decisions first-hand.

PHPEmbed, phpsh and HipHop
Facebook uses a lot of PHP, and along the way it has had to develop a lot of tools to make building super-complex and distributed PHP applications easier. This starts with phpsh, the PHP Shell, which allows developers to use tab completion and read documentation quickly.

Moving up the stack, we have PHPEmbed, a tool that promises to make it as easy as possible to embed PHP applications into a website.

And finally, we have HipHop for PHP, Facebook’s PHP compiler. PHP compiler, you say? Yes, HipHop pushes PHP code into highly optimized C++ code, so that it can be run quickly and efficiently at scale.

There are a host of other Facebook-created PHP tools, too, so be sure to scan around their developer page for the rest.

The Facebook SDK
There are an awful lot of SDKs out there, for all sorts of different languages, but Facebook has produced one of the slickest and most language-friendly sets out there. For mobile, there are SDKs for Android and iPhone, while desktop developers have their choice of C#, JavaScript, PHP or Python.

And, thanks to the wonders of GitHub, you can just grab these SDKs right out of their home repositories rather than signing up for a developer account and waiting for validation, or even shelling out some cash, as other platforms require. Each language can be augmented by some cool Facebook-developed tools, too. Three20, for example, is a neat Objective-C library that gives developers a host of new UI elements and data helpers for iPhone applications.

Apache Hive
In case you didn’t know, Hive was created at Facebook. Of course, with a 45+ petabyte Hadoop cluster running to keep track of all our clicks and connections, it’s no wonder Facebook’s engineers decided to write their own data query language and layer for the platform.

Hive’s primary accomplishment is not being Pig. Some users of Hadoop had been longing for a more SQL-like way of writing queries for this massive information store, and the Facebook team delivered. While Hive isn’t strictly SQL, it’s close enough that someone who is familiar with the query language can muddle through and figure things out. And for developers who don’t want to write their map/reduce jobs in HiveQL, they can just plop in their regular job code, and Hive and Hadoop handle the intermixing.

Open Graph
Currently in beta, the Open Graph API lets developers dive even deeper into the worlds of their users. Instead of just allowing users to share things they like with friends, Open Graph allows developers to push relevant content into a user’s page.

It’s a bit like a recommendation engine on steroids. Instead of just seeing that both Dick and Jane know each other, externally hosted applications can now also see that both Dick and Jane like the Rolling Stones, watch Netflix, and plan on attending an opera on Saturday.

All this new access to folks’ personal information may sound a tad Big Brother-ish, but for developers in enterprises, this should sound like marketing gold. Because it is. As the API firms up more, Facebook will start to show off what can be done with it in more sample applications, but for now, the real challenge is to come up with interesting ways to make this work for you.