Archive for June 11, 2010

Friday, June 11, 2010

C vs. C++ for Linux Kernel Development

Linus Torvalds:

One of the absolute worst features of C++ is how it makes a lot of things so context-dependent—which just means that when you look at the code, a local view simply seldom gives enough context to know what is going on.

And:

There’s no “debugger” in communication. There is no IDE that helps figure out what’s going on. There is no syntax highlighting etc.

There are just e-mails with patches and suggestions flying around. There’s no room for special tools—if you as a human cannot see what the code does from the change, it’s a problem. And you usually see about three lines of context around the code.

In this situation with hundreds or thousands of developers, primitive tools, and a huge code base, it makes more sense to optimize for clarity than conciseness or abstraction power.