There's a persistent idea out there that open source is about philanthropy; and certainly, many developers are happy to give away code. But for commercial organisations, participating in open source needn't be seen as a charity project. The long-term benefits can be significant, even if the immediate gains aren't always obvious.

Take Google, for example. It's no secret that Google has benefited immeasurably from open source. Its search cluster is built from thousands of Linux boxes. The cost savings alone, compared to licensing fees for Unix or Windows servers, must be tremendous.

But with competitors such as and Microsoft circling in the waters, search is IT’s most competitive sector. So why would one of today's most closely watched companies spend untold thousands on open source projects, especially when it can't even be sure those projects will advance its business in any way?

Yet that's exactly what Google is doing. On June 1, Google announced an initiative it calls the Summer of Code. The rules are simple: Any registered participant who successfully completes work on an open source project by 1 September will earn a stipend of $4,500 (£2,485).

Is it a cynical ploy? A way for Google to get its odd coding jobs done on the cheap? Not at all.

Not only is Google letting participants pick their own projects, but the search giant has turned control of the program over to other organisations. It is relying on partnerships with existing open source "mentoring organisations," including such notables as the Free Software Foundation, the Mono Project, and Ubuntu Linux.

Perhaps strangest of all, Google makes no claims on any code the participants produce. It will be truly open source. All projects must be released under a qualified open source license, but the copyrights are retained by either the author or the participating mentoring organisation, depending on the organisation's usual practice.

So why do it? What does Google stand to gain? The answer is, potentially, a lot.

When all is said and done, Google is a software company. And software companies need programmers. By fostering interest in software development among students, Google helps to ensure a healthy computing ecosystem, which will continue to generate new, talented coders.

Besides, if Google doesn't benefit directly from all the participants' projects, so what? It might benefit directly from some of them, if not now, then in the future. Think of the Summer of Code as a mutual fund; it's designed to pay off in the long term.

That's the key for other companies considering participating in open source as well. Return on investment is important, but resist the temptation to focus solely on short-term gains. The community aspect is what makes open source unique, and what benefits the community ultimately lifts all boats.