Why are we using C again?

It has been a while already since I last ranted about the main programming language used for Gnome. Mostly because you are not forced to use it and so I did not. But recently there were some posts on Planet Gnome which reminded me how inherently broken the core of Gnome is. I mean we have all this nice libraries like GTK, Glib etc. and they are easy to use and generally well designed, but when you want to hack on the core of them you have to use C.

I understand that back then when the Gnome project started C++ was in a very high flux with uncertain design bad compilers and so Gnome was written in C instead.

But looking at C++ today especially at the modernizations coming with C++0x (which are mostly already available in gcc4.4 btw.) it is really hard to understand why C is still used.

Just look at the linked examples; since C does not provide any build-in concept of iterators and the language is not flexible enough to provide them as library even experienced Glib developers iterate over lists in O(2^n) instead in O(n). How braindead is that? Instead of re-using the object concept and the syntactic sugar provided by C++ we are re-inventing the wheel with Glib. Luckily the community lately noticed that the syntax using Glib is so fucked up so you are not being productive any more. And what was decided as a solution? Reinvent the compiler by writing Vala – WTF?? There is already a compiled language which is compatible with our old code and which looks almost identical to vala; C++.

And I am not the only one who thinks that C++ is generally preferable over C. Here is a presentation discussing writing GCC in C++ which eventually happened. And these people are writing compilers so they should know if the language switch is worth it…

I thought the great thing about OSS is that you dont have to reinvent the wheel, but simply can use the well tested ones. Sometimes I really question the sanity of the Gnome developers…

Exit mobile version
%%footer%%