Date: Fri, 24 Jun 2005 15:02:41 -0500 (CDT) From: =?ISO-8859-1?Q?Se=E1n_C=2E_Farley?= <sean-freebsd@farley.org> To: Ryan Sommers <ryans@gamersimpact.com> Cc: hackers@freebsd.org Subject: Re: To C++ or not to C++ Message-ID: <20050624145937.E20046@thor.farley.org> In-Reply-To: <2140.66.166.104.222.1119623653.squirrel@66.166.104.222> References: <2140.66.166.104.222.1119623653.squirrel@66.166.104.222>
next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-948064467-1119643361=:20046 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 24 Jun 2005, Ryan Sommers wrote: > Greetings all... I'm about to undertake a major software engineering > project and I can't decide between C or C++ and was wondering if I > could get some input from the community. > > As part of this project I'm going to need to make use of at least 2 C > libraries (OpenSSL and ncurses) and the application must be compatible > with the standard range of Linux/UNIX compilers and operating systems. > All of these signs make me sway closer to just doing it in C. However, > one strong point always seems to pull me back to C++, constructors and > destructors. > > Constructors and destructors can offer so much in the way of memory > leak avoidance. Of course, each language can leak memory like a sieve > if used improperly. However, for statically allocated structures > semi-automatic garbage collection can be a nice cushion. > > Anyway, without getting into too much detail. Anyone had to make this > choice on a project? What were your thoughts in retrospect? What would > you have done different, what would stay the same... > > PS For this project things like polymorphisms and inheritance really > aren't needed. If you would like to use C but want some sort of memory handling, I can recommend using the Apache Portable Runtime (APR) in /usr/ports/devel/apr which uses memory pools. Although I have not used it before, there is also the Boehm Garbage Collector found in /usr/ports/devel/boehm-gc. Se=E1n --=20 sean-freebsd@farley.org --0-948064467-1119643361=:20046--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050624145937.E20046>