[DGD]Re: [MUD-Dev] C# vs. LPC
Felix A. Croes
felix at dworkin.nl
Tue Jun 27 23:53:47 CEST 2000
Travis Casey <efindel at earthlink.net> wrote:
> Tuesday, June 27, 2000, 12:18:02 PM, Christopher Allen <ChristopherA at skotos.net> wrote:
>
> > I was wondering if there were any of you c language experts who could
> > compare and contrast Microsoft's new C# (cee-sharp) language with
> > LPC.
>
> > http://msdn.microsoft.com/vstudio/nextgen/technology/csharpintro.asp
>
> > How different are they? How alike? Any worthy things in LPC that should
> > be in C#, or worthy things in C# that make sense for LCP?
>
> I'll take a quick shot at it. Note that while I know LPC quite well,
> all I know about C# is what I read on that page and in the two
> documents that are downloadable from that page.
>From what followed, I assume that the LPC dialect which you are most
familiar with is the MudOS one. (I make this point because I am
cross-posting my response to the DGD mailing list, where Christopher's
original posting also went.)
>[...]
> C# provides error handling through both throw and try mechanisms; the
> versions of LPC that I know of have only throw, and have a global
> catch. The C# info I have doesn't mention whether catches are global
> or local.
C# has exception handling in the Java/C++ style, LPC's support for
catching errors is rudimentary only. Whether the more advanced
style is also an improvement is perhaps a matter of taste. Personally,
I <hate> having to hunt through multiple catches to find out where
the flow of control went.
>[...]
> Where LPC uses either function pointers or closures, C# has "delegate"
> classes. Since I've never worked with delegate classes, I can't
> comment on any differences in functionality or ease of use.
C#'s delegate classes implement ordinary C-style function pointers.
> C# provides "versioning" support -- which, from what I can see,
> basically means merely that you have to explicitly say that you want
> to override inherited methods, variables, etc. I don't see this as
> likely to be a problem in a typical mud environment.
When I first saw this mentioned in the doc, my heart made a little
leap -- I was hoping for something that would improve on Java's
failure to deal with the replacement of class code, without a cold
boot of the entire runtime system. Alas, I was disappointed.
> It also provides namespaces, which allow programmers to have multiple
> namespaces and specify which they are using. Again, I don't see this
> as likely to be a problem in a typical mud, especially when using LPC.
> (You can't directly reference variables in other objects, so each
> object already has its own namespace.)
Interestingly, this is one of the things that make LPC such an easy
language to work with.
>[...]
> Both languages allow multiple inheritance. C# also has the idea of
> interfaces, as in Java, and allows objects to implement multiple
> interfaces.
LPC has multiple inheritance. C# has only single inheritance.
>[...]
> Overall, they both seem to be headed in the same direction -- towards
> a more object-oriented and "user-friendly" version of C. If you're
> building a mud, you might want the mud-oriented features of an LPC
> implementation -- on the other hand, if you don't like how LPC
> implementations handle those, you may not.
DGD's dialect of LPC is definitely not headed towards a user-friendly
version of C. I very much doubt whether any other LPC dialect is,
either. I rather think C is where LPC started, and from which it is
moving further and further away.
Regards,
Felix Croes
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list