Declaring Event Handlers in C# is Just Painful, Prove me Wrong Please
So I like VB better than C# for many reasons. Primarily because development experience in VB is built to help productivity. The Development experience in C# is built around being proud of the language rather than solving problems quickly. I could point out many things and have yet to really hear a good argument favoring C#. The only thing C# seems to have an advantage on right now for me (key point there, me) is better support for Lambda expressions.
Creating event handlers is super easy in VB. In the code-behind select events from the top-left dropdown for the Window|Page|Control (you like the usage of the | syntax right), then select the event from the Event list in the top-right drop-down. Then bam! You have a properly signatured event handler for the event that even tells you right there it is a handler for the event in question. Man that second part is so useful when you are reading through code to know what that method is responding to.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Now in C# you…..well you are stuck going back to the design surface of your form. Opening the Properties Window for the Form|Control|Page you are working with, then clicking the Event button
in the Properties Window. Then finding the event you want and typing in a name for the method you want to use and it will then take you directly to the method once you leave focus on that event, even if you want to create another event handler for another event. I find this process very tedious and time consuming. It is also not very natural in my opinion. If I am working in the code I do not want to leave what I am doing to go back to the design surface.
I Twittered my delima and got a couple of responses telling me how easy it is, EventName TAB TAB for example. This does nothing useful, just creates a Type name for something I was not even thinking about usually.
I was also told something about snippets, and let’s face it C# has no clue about the use of snippets, there are like 20 or 30 and they help you do things like create if statements. VB has like a zillion out of the box and you can do things like call the Mars rover if you want (that is a sarcastic joke).
So with this I ask, can you tell me how to do this very simple and useful task in C#? I have C# books, I even have the Chris Sells WinForms book and yet nothing I can find to help with the common task.
I say this not a chest thumper for VB, but as someone who does work in both languages. Yes I am primarily VB and honestly that is because in Visual Studio it really just helps you write code and does not force you to clutter your brain cells with remembering stuff that does not help you solve the customer problems. So make C# a more pleasant experience for me and anyone else who wants to explore C# as a .NET language. This is something that has really bugged me for a while and I have asked for help, to no avail. I have searched and searched and nothing. So help me understand why this is so cumbersome and how to make it not cumbersome.