Why is not more FreeBSD software written in C++?

Benjamin Lutz benlutz at datacomm.ch
Mon Apr 17 21:06:49 UTC 2006


On Monday 17 April 2006 16:47, John Baldwin wrote:
> 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.

I perceive the syntax of C++, C# and Java to be very similar. The differences 
are minor. What about C++ is clunky that isn't also clunky in C# and Java? 
One thing that comes to mind is that you can't use >> with nested templates, 
but then that's not one of the most common things a C++ programmer writes 
anyway. The things that bug me about C++ are mostly semantic in nature (no 
uniform access or read-only vars, requiring you to manually create accessor 
functions for everything, for example. Or no contracts, but then none of the 
mentioned languages offer that.)

> At work I recently described C# generics as "C++ templates that don't
> suck" for example. :)

But C# templates offer little over the C++ ones (well, ok, there is one thing, 
template type specification, that's nice), but have severe limitations. Why 
do you like them better?

> 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.

Sure, there won't ever be a dwim language. But every mechanism that prevents a 
class of bugs categorically is a step in the right direction, imo (that'd be 
the direction of correctness). I'm aware that C++ isn't much of an 
improvement over C when it comes to providing such mechanisms. However, it 
does make writing code more comfortable (well, if you know it, and like OOP), 
and it is actually shipped with the FreeBSD base system.

Cheers
Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-chat/attachments/20060417/f4b0fe38/attachment.pgp


More information about the freebsd-chat mailing list