when is VB.Net getting anonymous delegates?

  • Thread starter Thread starter PJ6
  • Start date Start date
All methods to create an event handler in code in C# can be used in VB.Net

However, as extra in VB Net you simple can add multiple events to a method
by simple adding the handles clause to the declaration, so mostly you don't
have to search for the place where the handler is.

The way a event is assingned in the designer of C# shows that it has not
such a long evolution of that as in VB, however as C# devolepers unknown by
VB.Net find everything in C# better then VB they tell you that C# is better.

I use both lanugages. As I am doing maintenance in C# I see often the most
awful constructions.

Cor
 
Cor Ligthert said:
All methods to create an event handler in code in C# can be used in VB.Net

However, as extra in VB Net you simple can add multiple events to a method
by simple adding the handles clause to the declaration, so mostly you don't
have to search for the place where the handler is.

I'm not questioning that they generally do things differently, nor even
that the VB way is easier to understand/use -- I'm questing your
statement that it has "more possibilities". If you just mean that it's
got more ways of doing the same thing, then OK, if you mean that VB
can do more with events, that I just don't see.
 
J.B. Moreno said:
I'm not questioning that they generally do things differently, nor even
that the VB way is easier to understand/use -- I'm questing your
statement that it has "more possibilities". If you just mean that it's
got more ways of doing the same thing, then OK, if you mean that VB
can do more with events, that I just don't see.

Can vb do the add/remove handlers that can be done in C#? Something like the
code below. If VB can't do this then VB is actually more limited in regards
to events. Not that that's a big deal this would have to be about the least
used feature of C#. If Cor is saying that VB has a simpler event syntax than
C# then he is definately right, I actually don't mind the handles keyword.
Although C# has got a lot better in regards to events since 2005 with the
introduction of generics, defining your own events used to be a pain but now
it's a little easier.

class SomeClass
{
private EventHandler _SomeEvent;

public event EventHandler SomeEvent
{
add
{
_SomeEvent = (EventHandler)EventHandler.Combine(_SomeEvent,
value);
}
remove
{
_SomeEvent = (EventHandler)EventHandler.Remove(_SomeEvent,
value);
}
}
 
How they calculate the score is all documented and open on the tiobe website

But indeed you are right they include all VB dialects , so in that light
seen you could indeed state that C# is already on top as it only comes in
one flavor
however do not forget that this is just statistics and with statistics it is
as with stock rates they may react on peoples feelings although the feelings
might be based
on unrealistic thoughts or believings .


:-)


regards

Michel
 
Cor ,

And i honestly believe that the T-SQL base is pretty low ( in the companies
i worked for i was mostly the T-SQL Guru and i am not that good ) , i hope
you are also talking about Transact SQL and not about "plain" SQL as this is
grouped seperate in the index .




Michel
 
Back
Top