Re: Why C#?
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Wed, 12 Apr 2006 22:56:09 +0200
Note that Office applications are COM automation servers, they were designed
to be scripted, that is, the interfaces are to be consumed by (late bound)
scripting clients like VBScript and non scripting (late & early bound)
languages like VBA, VB and C++ which all do support late binding, optional
and named arguments.
Apparently, the C# team (rightfully) assumed that VB.NET would become the
language of choice for the task at hand, so they didn't implement the
features at the compiler level like VB.NET and JScript.NET did.
Willy.
"Jason Newell" <nospam@xxxxxxxxxx> wrote in message
news:%23fnZI$mXGHA.2376@xxxxxxxxxxxxxxxxxxxxxxx
| Alvin & All,
|
| Thanks for the responses. My main source of COM Interop interaction is
| via CAD applications. I develop solutions using both C# & VB.NET and I
| guess I just hadn't noticed that big of a difference that would make me
| say one language handles COM Interop better than the other.
|
| I guess I just got hung up on the "C# lacks some support where VB.NET
| does". When I read it, it implied to me that VB.NET can accomplish COM
| Interop tasks that C# can't. They can both accomplish the same tasks,
| but sometimes using different methods. All that said, I now understand
| your scenerio.
|
| Thanks for the input.
|
| Jason Newell
|
| Alvin Bruney wrote:
| >>I believe it's just a case of VB.NET supporting optional parameters and
| >>"loose typing"
| >
| > That's about the sum of it. But while i'm here, i'll add that .NET
enforces
| > pass by value semantics. For MS Word (not Excel) API require pass by
| > reference, C# stumbles because these objects require a reference be
added
| > everytime. Imagine typing ref 30 times in order to satisfy the compiler
for
| > the open workbook method?
| >
| > Further, only lvalues can be passed by reference otherwise the compiler
| > barks really loudly. The sum total of this results in an exercise of
torture
| > for C# developers building real world Office apps in .NET.
| >
| > C# also stumbles for properties that accept more than one parameter
while VB
| > handles this with grace. In fact, you will see numerous get_object and
| > set_object methods in C# for the Office PIA's to fix this evil. A couple
| > other things can go here as well but it's enough to bake the point in.
| >
| > Although the literature will not come out and explicitly tell you so, it
is
| > wise to avoid C# for Office based apps because it is inferior for Office
| > automation in the current context.
.
- Follow-Ups:
- Re: Why C#?
- From: Alvin Bruney
- Re: Why C#?
- References:
- Why C#?
- From: Marty
- Re: Why C#?
- From: Alvin Bruney
- Re: Why C#?
- From: Jason Newell
- Re: Why C#?
- From: tdavisjr
- Re: Why C#?
- From: Jason Newell
- Re: Why C#?
- From: Jon Skeet [C# MVP]
- Re: Why C#?
- From: Alvin Bruney
- Re: Why C#?
- From: Jason Newell
- Why C#?
- Prev by Date: Re: sizeof(T) for C# 2.0 generic classes
- Next by Date: HttpWebResponse and ServerProtocolViolation
- Previous by thread: Re: Why C#?
- Next by thread: Re: Why C#?
- Index(es):
Relevant Pages
|