[AccessD] C# automation of office

jwcolby jwcolby at colbyconsulting.com
Sun Jan 31 09:49:52 CST 2010


Mark,

 > (Wow, it took MSFT over 5 years to finally handle optional parameters properly !?)

My understanding is that optional parameters are defined in the VB language specification, whereas 
they have never been defined in the C language specification.  IOW VB had them because (for whatever 
reason) VB defined them in the language.  This includes VB.NET AFAIK.  C did not have them because 
they were not defined in the C language specification.  Microsoft did not define the C language, it 
was defined long before Microsoft even existed.

Adding optional parameters to C# took some doing and are part of Microsoft's effort to move the 
languages closer together, give each language the parts of the other language that they never had 
before.

It has been the case since the beginning of .Net that, as Microsoft has always said, each language 
is a valid and capable language but each language had a few things that the other didn't.  Because 
you are familiar with VB you are aware of the VB abilities missing in C#, but you probably are not 
aware of the C# items missing from VB.

As an example of another significant difference, VB's SELECT statement allows you to stack cases on 
the same line:

Select case x
  Case "A", B"

This is not valid syntax in C

These kinds of things are syntactical differences and making the two languages handle things that 
they were not originally designed to do is not necessarily a trivial task.

John W. Colby
www.ColbyConsulting.com


Mark Simms wrote:
> Very interesting and thanks much for the lesson.
> (Wow, it took MSFT over 5 years to finally handle optional parameters
> properly !?)
> 




More information about the AccessD mailing list