[asterisk-dev] Why not C++? (was: Re: asterisk-dev Digest, Vol 40, Issue 20)

Matthew Rubenstein email at mattruby.com
Wed Nov 7 13:53:47 CST 2007


	Asterisk was written in C by Mark Spencer for his own reasons. Perhaps
because he was a better C programmer than C++. Perhaps, like many other
programs, he thought it would be a relatively small, simple program,
that wouldn't need the overhead of design that large, complex C++
programs require to be worth using the language - and then it grew and
grew.

	Now Asterisk is written in C because it was already written in C. And
no one has been interested in rewriting the whole thing in C++, when
there's lots of work to do fixing the existing code and adding
incremental features.

	C++ is a fine language. It was in fact created by Bjarne Stroustrup at
AT&T after analyzing the Unix kernel's limited abilities in distributed
computing: http://en.wikipedia.org/wiki/C%2B%2B#History . AT&T's large,
distributed Unix problems are exactly the kind that Asterisk processes
on Linux.

	So if you want to recode Asterisk in C++, go right ahead. That's what
open source is all about. FWIW, I'd suggest writing a module wrapper
that can use C++ modules. Then you could start recoding both inside and
outside that interface, gradually converting the app. Sounds like an
awful lot of work. But I'd love to try to use the results, so long as I
don't have to do the coding :).


On Wed, 2007-11-07 at 13:37 -0600, asterisk-dev-request at lists.digium.com
wrote:
> Date: Wed, 7 Nov 2007 12:21:13 -0600
> From: "Power, Paul C." <ppower at integratelecom.com>
> Subject: [asterisk-dev] Why not C++?
> To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
> Message-ID:
>         <BE04AAE769A87A49B359C067BB777E520400AF at maidbmn8.corp.eschelon.com>
> Content-Type: text/plain;       charset="us-ascii"
> 
> All-
> 
> I was wondering why Asterisk is not written in C++ or if 
> there is any interest in having Asterisk written in C++.
> 
> I have been watching the list of bugs and other proposed 
> changes to asterisk (fast-ast2).
> It has occurred to me there may be great values in leveraging 
> something like the BOOST libraries to take care of some of 
> the minutiae that seems to cause problems.
> 
> I am thinking mostly collecitons, threading, string processing.
> 
> If this have been discussed before, could some one direct me to it?
> 
> I am interested in hearing any and ALL opinions!
> 
> 
> PCPIII
-- 

(C) Matthew Rubenstein




More information about the asterisk-dev mailing list