[Mono-list] Pure C# vs. PInvoke

Sebastien Lambla sebastien.lambla@6sens.com
Wed, 18 Jul 2001 11:03:11 -0700


Hello all,

I did a lot of thinking lately about the pure C# way of coding versus the
PInvoke way. So I have a new proposal :

1. A naming convention for files to differentiate pure C# (thus working
everywhere there's a CLR) from "native" C# (thus platform dependant): (P |
N)[.OSName.OSVersion].ItemName.cs
A pure C# "Whatever" class would then be called P.Whatever.cs, and this same
class binding to a 2.4 Linux version would be called
N.Linux.2.4.Whatever.cs.
That way, when a new CLR on a new platform appears, it will be very simple
to use the Pure C# classes when available, and to create an optimized bind
version later. What do you think? Let's take for example Winforms. If
someone decides to implement the System.Windows.Forms namespace using only
the System.Drawing, then if a new CLR appears on BeOS, it will first bind
System.Drawing, thus get full WinForms support very fast (although a bit
slow), and could then spend some time binding WinForms to BeOs Widgets...
2. A document convention
Could we define a schema for a standard xml file for each file we produce,
with full information, documentation, dependencies and such? (written by
John Doe, Requires System.Web library, etc.) We could then generate
documentations on the fly, and could even provide a web-based tool for
someone writing a new CLR to see what minimal set of native classes it
should implement...

And I get a question too :-)
When coding, should we implement all classes, or just the ones being
documented by Microsoft? (Like System.Web.Compiler namespace which is not
documented).

Thanks,

Sebastien Lambla