[plug] C's Preference

James Devenish devenish at guild.uwa.edu.au
Sun Nov 30 16:59:42 WST 2003


Hi Alex,

In message <20031130084634.12190.qmail at web8102.in.yahoo.com>
on Sun, Nov 30, 2003 at 08:46:34AM +0000, Alex Bobby wrote:
> Any specific reason, why C is preferred to C++ OOP to code Linux.

This decision is not only seen with Linux. I don't know Linus' history
and motivations, but here are some generic reasons why UNIX-like kernels
are written in C and not C++ OOP:

 - UNIX was written in C.
 - C is a small, stable language (C++ is large and too new).
 - If you know about compilers and linkers, you'll know that C++ OOP is
   pretty troublesome for making general-purposes operating systems.
 - At runtime, C++ adds a lot of complexity to memory handling and jump
   handling.

If nothing else, it's simply impractical to support C++ as the lowest
common denominator for compilation, linking and execution. Therefore, it
is generally a bad idea to use it for kernels (despite possible coding
advantages).


_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list