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

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBERANkgShs4qbRdeQRAj65AJ9M9MoD/vsHUPbQNrnHCN0p5X2++wCfXk9c
FniOF3I61jWmEXP96gRBqmI=
=w7Y4
-----END PGP SIGNATURE-----

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