Programming Language (was: State of the GnuCash project: A call for help)

Christian Stimming stimming at tuhh.de
Tue Aug 12 11:56:34 CDT 2003


Carl L. Gilbert schrieb:
>>>I expect the ramp up to take at least 2 months...I assume its c code?  
>>>Hopefully its c++ and object oriented!?  I know nothing about Linux
>>>GUIs, so Ill stay behind the scenes.
>>
>>GnuCash is written in C and Scheme.  No C++.  It's somewhat object
>>oriented, but probably not to a C++/Java-coder's wishes.
> 
> Ugh.  'c'.  the pain.  I write c at work.  embedded software.  I think c
> just requires lots more upfront architecting.  with OO languages like
> java/c++ I have been able to dive right in, and sort of refactor along
> the way.  
> 
> Anyway, is their any particular reason for it being in c and not c++?  I
> am really a self taught programmer so I don't know some of the finer
> details about such decisions.

We should really create a writeup about "why is this in C?" and put it 
somewhere on the website (or in the to-be-created wiki; I still propose 
http://gnomesupport.org/wiki/ ). People ask this *all the time*.

My take on this:

*Gnucash was started in 1998*. That's basically it. C++ compilers were 
not yet mature and standarized enough on the variety of platforms 
considered at that time. Same for Java or Python. So C was the only 
option *at that time*. The only way to switch to a new language since 
then would be to start from scratch. But an accounting software is too 
complex to do this -- this is precisely why no Open Source competitor to 
gnucash exists. So, in Open Source accounting software there is no way 
around gnucash, and it has to be taken in the programming language it is 
-- which happens to be C because of the time of the project start.

Additionally the GUI toolkit comes into play. The decision for Gnome/GTK 
was made IIRC in 1999, at which time Qt would have been possible, too, 
but not gtkmm, wxpython or anything else. So the decision was made for 
the C-based Gnome/Gtk platform, and the current GUI code is just too 
incredibly huge to even consider starting it from scratch. So we're 
pretty much stuck with C and gnome/gtk for GUI code. The developers 
tried to make the best from it and employed Object-Oriented programming 
techniques as good as possible, but the programming language stays the same.

Personally I would love to do the GUI programming in some higher-level 
language (scheme with gnome-guile, python with python-gtk, C++ with 
gtkmm). Maybe the modular system organisation would make it possible 
some day to have some modules written in languages other than C. But 
setting things up correctly will be a major headache, not to mention the 
additional dependencies etc. -- so for the time being I will just 
continue to do OO-programming in C.

Christian



More information about the gnucash-user mailing list