Gnucash c++

Christian Stimming christian at cstimming.de
Mon Aug 11 16:52:27 EDT 2014


Hi Aaron,

thanks for investing time in Gnucash and also in its development towards more 
future-proof programming technologies. I was a bit puzzled about the benefit 
of switching the "normal compiling" from C to C++, just by itself. IMHO, there 
is of course an immediate benefit if the data structures move from plain C 
structs to C++ classes, with constructor/destructor and such. If you plan to 
do such a transition with any of gnucash's data structures, of course every 
code using those will have to be C++. However, just changing this into C++ 
doesn't also solve the problem here: The usage of the C structs in the code is 
just that: C structs, with foo_new() and foo_delete() functions and maybe even 
glib's reference counting. To really use C++ classes instead, every single 
usage of those old C idioms will have to be replaced by proper C++ constructs. 
IMHO, "just" switching the C compiling to C++ doesn't quite bring you much 
gain here. Do you think it helps you much? I have some doubts. I see some more 
benefit when changing individual data structures to C++, then switching the 
old C functions into wrappers that make the new C++ behaviour available to the 
C side. This means the existing C code can continue to compile in C, and the 
next steps would rather be to open the possibility for new C++ code such as 
unittests and maybe new GUI code in C++ (or python or something similar). IMHO 
this would be more benefitial. What do others think?

Regards,

Christian

Am Mittwoch, 6. August 2014, 13:26:14 schrieb Aaron Laws:
> The motivation is to investigate a different strategy for migrating to C++.
> I was skeptical that it would work at all, but, through argument, I
> couldn't come up with any solid reasons why it couldn't work, so I decided
> to give it a go. The strategy is:
> Step 1) Get the project to compile as C++. Step 2) add poison to remove non
> c++ idioms, etc. Step 3) Make higher level changes.
> And the strategy entails that these steps are followed quite strictly. So
> far, I don't consider Step 1 complete, because although the project
> compiles and links, it's not shippable ... perhaps not even close :-).
> Like... nothing works.



More information about the gnucash-devel mailing list