Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Apr 2006 03:39:23 -0600
From:      <mail.matt.mcdonald@gmail.com>
To:        "'John Baldwin'" <jhb@freebsd.org>, <freebsd-chat@freebsd.org>
Cc:        'Benjamin Lutz' <benlutz@datacomm.ch>
Subject:   RE: Why is not more FreeBSD software written in C++?
Message-ID:  <4444b3cb.576eeb75.6445.3f08@mx.gmail.com>
In-Reply-To: <200604171047.30753.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I agree that if you're worried about buffer overruns, etc then managed code
is the way to go. C#2.0 especially seems to be more and more viable as an
all out c++ replacement since it seems to have an analog to all of the major
language features of c++, plus a lot of added syntactic sugar.
 
The only problem is that all of the install scripts should run with the
smallest system possible, and for that sh or c is probably the way to go.
-Matt McDonald

-----Original Message-----
From: owner-freebsd-chat@freebsd.org [mailto:owner-freebsd-chat@freebsd.org]
On Behalf Of John Baldwin
Sent: Monday, April 17, 2006 8:47 AM
To: freebsd-chat@freebsd.org
Cc: Benjamin Lutz
Subject: Re: Why is not more FreeBSD software written in C++?

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
_______________________________________________
freebsd-chat@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-chat
To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4444b3cb.576eeb75.6445.3f08>