[asterisk-dev] Why not C++?

Matthew Nicholson mnicholson at digium.com
Wed Nov 7 13:58:19 CST 2007


On Wed, 2007-11-07 at 14:30 -0500, Jon Pounder wrote:
> Quoting Matthew Nicholson <mnicholson at digium.com>:
> 
> > On Wed, 2007-11-07 at 12:21 -0600, Power, Paul C. wrote:
> >> 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!
> 
> relying on stuff like this just adds SOOOO much overhead to code that  
> needs to be fast its unreal.

This is not universally true.  See adobe's gil library for an example of
code written in C++ that is highly efficient
(http://opensource.adobe.com/gil/ there is a performance comparison in
the video tutorial found in the documentation section).

> it also hides a lot of the stuff a good programmer likes to have  
> control of like making sure startup and cleanup are actually symetric,  
> and knowing that there is no hidden stuff around structures that need  
> to be exactly as they are laid out to map onto something else.

You can also make the argument that any sort of abstraction does this,
from the internals of ast_read() to the internals of std::string (from C
++).

> the problem is everyone learning to program in the last 10-15 years  
> relies on this stuff so heavily the art of really programming is  
> becoming lost, and no one knows how to make something more efficient  
> when they need to since they didn't write 90% of the code or even know  
> how it works internally.

This, I can agree with.

-- 
Matthew Nicholson
Digium




More information about the asterisk-dev mailing list