Re: Why is not more FreeBSD software written in C++?
--nextPart1846146.lFr91Y3I4J
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Thanks for your comments all that replied.=20
So to summarize, it seems there are really no technical reasons to not use =
C++=20
for base system apps in FreeBSD. A quick look at /usr/src reveals a number =
of=20
programs that do actually use C++: devd, gperf, groff and OpenSSL. The=20
reasons seem to be more circumstantial or personal: the individual develope=
r=20
simply prefers to use C.
Why did I even ask the question? I perceive correctness as a big problem wh=
en=20
programming in C. It is difficult to know for sure that a C program is=20
correct, since there are no guards against mistakes like string buffer=20
overflows, erroneous pointer handling or memory allocation. C++ is of cours=
e=20
far from being a golden bullet, but it does solve some of the problems (usi=
ng=20
C++ strings instead of char* generally means you don't have to worry about=
=20
string buffer overflows).
I realize this is first grade flame war material, so I'll stop with languag=
e=20
advocacy now. Yes, I also realize that experience and knowledge are more=20
important than technical language features :) .
I've lately started spending some thought on code correctness and reliabili=
ty.=20
=46rankly, I find the current situation appalling. All the time bugs are fo=
und=20
even in very well tested software that could easily be prevented or=20
statically recognized by better software construction tools. The big questi=
on=20
is, of course, when those tools are available (and some are already), what=
=20
does it take to get people to use them.
Cheers
Benjamin
--nextPart1846146.lFr91Y3I4J
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQBEQlmjgShs4qbRdeQRApRzAJ9KTZvkqPc1VsAVurCDF6JgptyOJgCgg0TW
Syw/6zsEGVWL7osxLfZPioY=
=hkel
-----END PGP SIGNATURE-----
--nextPart1846146.lFr91Y3I4J--
討論串 (同標題文章)
完整討論串 (本文為第 6 之 45 篇):