Why not using C++

Naveen Verma ernaveenverma at gmail.com
Fri Oct 8 08:13:05 PDT 2010


Hi,

To me sounds a good idea, if we are implementing without STL. We had many
discussion earlier to have C++ based implementation. But it end up in the
believe that we will not get good performance. But this we can check once we
have an implementation.

-Br
Naveen


On Fri, Oct 8, 2010 at 1:07 PM, Jacques Guillou
<jacques.guillou at gmail.com>wrote:

> Hi,
>
> I am working on a project which has some similarities with DBUS, since it's
> an IPC framework involving a daemon process which dispatches messages to
> clients connected to it over a UNIX domain socket.
> It's currently completely written in C. Since the daemon has to support
> some pluggable components, I use some C structures which mainly contain
> function pointers pointing the my plugins specific function.
> These structures can be seen as a virtual function tables as they are know
> in the C++.
> Since implementing this in C is actually quite painful and error prone, I
> wondered whether it would make sense to implement this in C++ instead of C,
> WITHOUT using STL.
>
> According to me, there are already a lot of benefits of using the C++
> language itself over C :
> - Helps making the design of your application cleaner, when using object
> oriented concepts
> - Provides stricter type checking
> - Allows using templates
>
> Now the drawbacks (?):
> - Need a C++ compiler (nowadays, there's one on every platform we support,
> right ?)
> - Need to link against libstdc++ library (this can be avoided, as it is
> described in this thread :
> http://stackoverflow.com/questions/1653047/avoid-linking-to-libstdc)
>
> So now my question : Would it make sense (or would it have made sense) to
> implement DBUS in C++, without using any of the C++ libraries (STL,
> libstdc++, etc...), since the language itself provides some benefits over C,
> without any drawback (apart from the fact that some people don't know C++) ?
>
> What do you think?
>
> Best regards
> Jacques
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20101008/82c9c355/attachment.html>


More information about the dbus mailing list