Thursday, August 23, 2007

Yes, you can use C# controls in VB.NET code

I've been helping a student out using the Outlook-like Time Field Control I authored. She's been trying to port the code from C# to VB.NET. I've been trying my best to help her but unfortunatly it's been a long time (luckily) since I've had to deal with anything coded in VB.NET.

After a number of back and forths, I finally asked, "why exactly are you trying to port it over?" and her response was "surley i can't still use the control "as is" if its in C#?"

It seems that in all of her classes, no one failed to mention the CLS/Common Language Specification. She was even more surprised to hear that much of the CLR and .NET framework were authored in C#, even though she has been using it trouble-free in VB.NET.

Side note: If you are interested in why much of it is authored in C# I suggest you read Scott Guthrie's interview in the Architecture Journal.

This highlights one of the fundamental benefits of the .NET "world" - language neutrality. It doesn't matter if your coding in C#, VB.NET, Managed C++ or even Python.net for that matter, you can rest assured knowing that you can use components authored in any one of the supported .NET languages. Now that is productive!

2 comments:

Anonymous said...

ghghghgh

Anonymous said...

you're