Being new to both .NET and Silverlight, I have noticed that many of the tutorials for Silverlight (Tim Heuers Blog, Silverlight TV etc) are in C#. I know that the general difference between VB and C# is usually preference.
However one of the major differences I had noticed was the way C# and VB.NET handle events. Is this just a syntactical difference, or is one or the other optimized to handle events better? For example, they both get compiled down to the same Intermediate Language, but is the code that is generated identical? Seeing as Silverlight relies on this heavily, I thought it might be worth consideration.
Considering the expertise on this forum, I was wondering if anyone has done research into this, or performance testing.
The code that gets generated may not be identical down to the instruction, but the overall effect is the same. You should not see a performance difference in that area.
VB.NET has two syntaxes for events - AddHandler
, which is the same as C#'s +=
, and Handles
, which is just syntactic sugar for AddHandler
in a constructor.
They both get compiled to IL (or in this case Silverlight bytecode) and should perform exactly the same. Any differences should be just syntactical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With