Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2006 10:47:28 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-chat@freebsd.org
Cc:        Benjamin Lutz <benlutz@datacomm.ch>
Subject:   Re: Why is not more FreeBSD software written in C++?
Message-ID:  <200604171047.30753.jhb@freebsd.org>
In-Reply-To: <200604161650.11428.benlutz@datacomm.ch>
References:  <200604151313.32519.benlutz@datacomm.ch> <200604161650.11428.benlutz@datacomm.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 16 April 2006 10:50, Benjamin Lutz wrote:
> Why did I even ask the question? I perceive correctness as a big problem when 
> programming in C. It is difficult to know for sure that a C program is 
> correct, since there are no guards against mistakes like string buffer 
> overflows, erroneous pointer handling or memory allocation. C++ is of course 
> far from being a golden bullet, but it does solve some of the problems (using 
> C++ strings instead of char* generally means you don't have to worry about 
> string buffer overflows).

To be honest, if you want a "safer" language, I'd prefer going from C to
C# or Java.  C++'s syntax is, quite frankly, clunky in several places.
At work I recently described C# generics as "C++ templates that don't
suck" for example. :)

Also, many of the bugs I either have myself or run into in other people's
code come from the programmer not taking into account all of the conditions
(i.e. missing an edge case in implementation or design), and those type of
bugs are not something a language is going to solve.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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