[Mono-list] OT: C in mono

Piers Haken piersh@friskit.com
Thu, 1 Aug 2002 12:42:53 -0700


I have to say that I find it ironic that half the project is developed
in C# where OO concepts like abstraction, inheritance & aggregation are
explicit and even encouraged in the syntax of the language; and the
other half is in C where they're hidden in the semantics of the code.

I can't stand to look at modern C code (like the mono runtime, or the
Linux kernel) any more because every time I do I see these concepts
being shoehorned into a language that was never designed to accommodate
them. Structs and sets of functions with weird prefixes (due to the flat
namespace) that take pointers to those structs just shouting out to
become classes and methods. Tables of function pointers (with their
obtuse syntax) crying out to become virtual functions. Hoards of
different linked lists, hash tables (all taking (void*)) just begging to
be put out of their misery and replaced with shiny new, type safe,
inlinable STL code, and the macros, oh the macros. It's like purgatory
for a C++ guy.

But, you know, as long as it gets the job done, what the hell...

Piers.

> -----Original Message-----
> From: Jaroslaw Kowalski [mailto:jarek@atm.com.pl] 
> Sent: Thursday, August 01, 2002 5:19 AM
> To: mono-list@ximian.com
> Subject: [Mono-list] OT: C in mono
> 
> 
> Hi all!
> 
> Is there any reason why mono is developed entirely using C?
> Why not C++?
> 
> Quick look at mono/mono/metadata/ directory shows that you 
> guys are actually very good at emulating object oriented 
> concepts using C, which are more naturally expressible using 
> C++ syntax (classes, methods, member variables, virtual 
> functions). Of course you don't have to use all of C++ 
> language constructs, but you could benefit from using some of them.
> 
> IMHO when you write in C, the number of potential problems 
> resulting from the language itself is much higher than in 
> C++. How do you deal with it?
> 
> I assume there must be some sort of C coding style that 
> you're all following. I don't mean indentation style, but 
> rather a common way to express higher level constructs like 
> classes, virtual functions, exceptions, allocating and 
> freeing memory, namespaces. Where can I download such a guide?
> 
> I'm not a GNU/Linux guy (yet? ;-) but I've heard that gcc is 
> not so good ad handling c++ code. I've also heard that it's 
> not as portable as in C mode. Are there any more reasons why 
> you avoid c++?
> 
> Jarek
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-list
>