From: Javier O'H. <j....@ti...> - 2003-02-22 10:04:50
|
On Friday 21 February 2003 21:18, Robert Konigsberg wrote: > I have a question: Why is dia2code written in C? > > I assume that C compilers being more compatible across environments that > C++ is the reason. > > Okay, maybe that wasn't my actual question. My actual question should be: > Why would a project that has object orientation at its core, that would > attract people who specifically have OO experience, not written in an > object oriented language? 1. Speed. Being Dia2Code a tool to make other tools, and considering I didn't have a fast computer at the time, I didn't want to wait several minutes for it to compile (e.g. after a bugfix) while programming in C++/Java. 2. Compatibility. Not having the resources to compile every software I liked I usually downloaded the binary (rpm). Most of the time, programs written in C++ required a libc++ I did not have installed. Sometimes I could find the right binary, sometimes I couldn't. So I thought to free up the users from this dependency hell. This point is not longer valid, I guess, now that Linux distributions standardize on gcc 3.2. 3. Portability. As long as you stick with ANSI C, you can compile it on Linux, Win32, *BSD, you name it. One could be (mostly) sure not to find uncompatible environments (as opposed to C++). 4. Integration with Dia. It was natural to think it could become a Dia plugin, so I used the same language Dia was written in. 5. Because I can :-P. [ Side note: some people may argue - after reviewing my code - that I cannot code C properly. Let's just say that at least I can do a C program that mostly works. ;-) ] Today, of course, most of this points may no longer be valid. > It seems as though the code could do well with some C++ifying ... > > The whole project is only 5000 lines long as it is so it ain't size. The code surely needs some refactoring, be that in C or C++. Regards, Xav |