Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 2006 15:57:44 -0400
From:      James Bailie <jimmy@jamesbailie.com>
To:        freebsd-chat@freebsd.org
Subject:   Re: Why is not more FreeBSD software written in C++?
Message-ID:  <44415038.4020101@jamesbailie.com>
In-Reply-To: <4441199C.4090802@carebears.mine.nu>
References:  <200604151313.32519.benlutz@datacomm.ch> <4441199C.4090802@carebears.mine.nu>

next in thread | previous in thread | raw e-mail | index | archive | help
Benjamin Lutz wrote:

 > Why is it that C++ is not used for our programs? The C++
 > compiler is in the base and built by default, and the OOP
 > paradigm is a nice one, that many programmers, especially the
 > younger ones (like me :) ) are probably more familiar with than
 > the tricks and techniques used in C to achieve good efficiency.

Efficiency is of prime importance in systems programming.  The
only language in which one can write more efficient programs than
in C, is assembler, but it's not portable.  If someone is writing
something in C, then you can assume they are seeking efficiency
over convenience.  C is still the lingua franca of the
programming world.  You need to be proficient in it.

Many of us don't need C++.  It occupies the middle ground between
C and higher-level languages.  When I want high-level datatypes
or user-defined types and polymorphism, I work in Lisp, where I
am much more productive.  I work in C when efficiency is the
paramount concern, but even then, I would rather extend a Lisp
implementation with new primitives in C only where necessary, and
so avoid completely reinventing the wheel.  Many C++ programmers
have switched their allegiance to Java, in order to gain the
benefits of garbage-collection and freedom from pointer
manipulation without having to learn a new paradigm.

I doubt anyone would object if you wrote anything, except kernel
code, in C++, or even objective C, for that matter, as they are
all supported by GCC.

-- 
James Bailie <jimmy@jamesbailie.com>
http://www.jamesbailie.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44415038.4020101>