Home All Groups Group Topic Archive Search About

Re: Which do you prefer?

Author
6 Dec 2006 8:39 AM
Tom Shelton
On 2006-12-05, Blake <bl***@zgeek.com> wrote:
> You obviously don't do any async programming with .NET then?
>
> If you don't know how to manage handlers yourself you will be in
> trouble.
>
> The Handles keyword is fine for wiring simple button click events.
> Thats is the reason it is in VB and not C#
>

I think that is a little misleading...  I mean your right, there is nothing
really equivalent to handles in C# (thank goodness), it doesn't mean that the
IDE won't automatically wire up events for you.  You can just double click
your little button and get a default event handler just like you do in VB.NET
- the difference is that if at some point I want to change it a runtime I can
  :)

Really, I find VB.NET's handling of events cumbersome.  My main problem with
VB.NET isn't that its a basic style language - it's that it is to dang wordy
:)  Oh, and it's case insensitive - drives me nuts!  I like to be able to do
this:

public class TheClass
{
    private int theInt;

    public int TheInt
    {
        get { return this.theInt; }
        set { this.theInt = value; }
    }
}

In VB.NET, I have to resort to the dreaded underscore:

Public Class TheClass
    Private _theInt As Integer

    Public Property TheInt As Integer
        Get
            Return Me._theValue
        End Get
        Set
            Me._theValue = Value
        End Set
    End Property
End Class

Blah, blah, blah.  To much typing.

--
Tom Shelton

Author
6 Dec 2006 6:36 PM
Cor Ligthert [MVP]
Tom,

Today I selected in a C# project 30 controls, I mistyped an 30 events where
created.

In VB.Net it is just selecting and deleting.

Try it in your most important C# project.

Cor

Show quoteHide quote
"Tom Shelton" <tom_shel***@comcastXXXXXXX.net> schreef in bericht
news:efqdneQRrPk1HOvYnZ2dnUVZ_r6dnZ2d@comcast.com...
> On 2006-12-05, Blake <bl***@zgeek.com> wrote:
>> You obviously don't do any async programming with .NET then?
>>
>> If you don't know how to manage handlers yourself you will be in
>> trouble.
>>
>> The Handles keyword is fine for wiring simple button click events.
>> Thats is the reason it is in VB and not C#
>>
>
> I think that is a little misleading...  I mean your right, there is
> nothing
> really equivalent to handles in C# (thank goodness), it doesn't mean that
> the
> IDE won't automatically wire up events for you.  You can just double click
> your little button and get a default event handler just like you do in
> VB.NET
> - the difference is that if at some point I want to change it a runtime I
> can
>  :)
>
> Really, I find VB.NET's handling of events cumbersome.  My main problem
> with
> VB.NET isn't that its a basic style language - it's that it is to dang
> wordy
> :)  Oh, and it's case insensitive - drives me nuts!  I like to be able to
> do
> this:
>
> public class TheClass
> {
> private int theInt;
>
> public int TheInt
> {
> get { return this.theInt; }
> set { this.theInt = value; }
> }
> }
>
> In VB.NET, I have to resort to the dreaded underscore:
>
> Public Class TheClass
> Private _theInt As Integer
>
> Public Property TheInt As Integer
> Get
> Return Me._theValue
> End Get
> Set
> Me._theValue = Value
> End Set
> End Property
> End Class
>
> Blah, blah, blah.  To much typing.
>
> --
> Tom Shelton
Author
7 Dec 2006 6:17 AM
Tom Shelton
On 2006-12-06, Cor Ligthert [MVP] <notmyfirstn***@planet.nl> wrote:
> Tom,
>
> Today I selected in a C# project 30 controls, I mistyped an 30 events where
> created.
>

I'm not sure what you mean here?

> In VB.Net it is just selecting and deleting.
>
> Try it in your most important C# project.

Yes, if you manually delete the methods, it can be fun manually deleting the
event handlers from initialize component.  and your right, that doesn't happen
in VB.NET - but it happens so in frequently to me that I still see the C# way
of doing thing as a net advantage.

Don't get me wrong - I have no ill feelings against VB.NET.  I just happen to
like C-style languages is all.  It is what I have done most.

--
Tom Shelton