473,387 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Which do you prefer?

Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

Dec 4 '06 #1
114 3297
Playing your silly game:

When I'm developing/maintaining something using VB6, I use the former.

When I'm developing/maintaining something using VB.NET, I use the latter.
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

Dec 4 '06 #2
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub

Dec 4 '06 #3
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
I prefer the c# version :-)
>

Dec 4 '06 #4
"Blake" <bl***@zgeek.comwrote in message
news:11********************@l12g2000cwl.googlegrou ps.com...
Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
Never heard of control arrays?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
This isn't that good either as it would be better to use a for each
statement.

Michael
Dec 4 '06 #5
Blake,

Great answer, typical VB.Net style by the way.

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11********************@l12g2000cwl.googlegrou ps.com...
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
>Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub

Dec 4 '06 #6
Strange: although I use both languages do I find especially the handling of
handlers very weak in C#.

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

I prefer the c# version :-)
>>


Dec 4 '06 #7
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:

private button1 as new button

AddHandler button1.Click , AddressOf Click

' add the button to a form...

....

Private Sub Click(sender as Object, e as EventArgs)

MessageBox("Hello World!")

End Sub

Esentially the Handles keyword is wiring the event delegates for you.
That is all.



Cor Ligthert [MVP] wrote:
Strange: although I use both languages do I find especially the handling of
handlers very weak in C#.

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
I prefer the c# version :-)
>
Dec 4 '06 #8
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:

private button1 as new button

AddHandler button1.Click , AddressOf Click

' add the button to a form...

...

Private Sub Click(sender as Object, e as EventArgs)

MessageBox("Hello World!")

End Sub

Esentially the Handles keyword is wiring the event delegates for you.
That is all.



Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the handling
of
handlers very weak in C#.

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

I prefer the c# version :-)


Dec 4 '06 #9
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).
That is true but you also get inconsistency which can lead to problems for
maintenance programmers.

Michael
Dec 4 '06 #10
Any maintenance programmer worth hiring is not going to have a problem using
either syntax.

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
>Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).
That is true but you also get inconsistency which can lead to problems
for maintenance programmers.

Michael

Dec 4 '06 #11
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:

private button1 as new button

AddHandler button1.Click , AddressOf Click

' add the button to a form...

...

Private Sub Click(sender as Object, e as EventArgs)

MessageBox("Hello World!")

End Sub

Esentially the Handles keyword is wiring the event delegates for you.
That is all.



Cor Ligthert [MVP] wrote:
Strange: although I use both languages do I find especially the handling
of
handlers very weak in C#.

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

I prefer the c# version :-)


Dec 4 '06 #12
"Tim Patrick" <in*****@invalid.com.invalidwrote in message
news:e3*************************@newsgroups.comcas t.net...
Any maintenance programmer worth hiring is not going to have a problem
using either syntax.
That's not the point. Of course they can use either syntax but if 50 events
use one syntax and 1 event uses the other then I'd be suprised if they
didn't miss it.

Michael
Dec 4 '06 #13
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
Dec 4 '06 #14
Hi Blake:

I also prefer the AddHandler syntax and for the same reason you mention. I
find it more readable, more flexible and less ambiguous. One should never
mix the styles and I'd have the "Handles" code reworked if somebody
submitted them to me.
"Blake" <bl***@zgeek.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
>Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegr oups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:

private button1 as new button

AddHandler button1.Click , AddressOf Click

' add the button to a form...

...

Private Sub Click(sender as Object, e as EventArgs)

MessageBox("Hello World!")

End Sub

Esentially the Handles keyword is wiring the event delegates for you.
That is all.



Cor Ligthert [MVP] wrote:
Strange: although I use both languages do I find especially the
handling
of
handlers very weak in C#.

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

I prefer the c# version :-)



Dec 4 '06 #15
You mean, "Harder for MasterProgrammer to read."
Robin S.
---------------------------------
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
>On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub

Dec 4 '06 #16
Good programming is about leaving breadcrumbs for the next person. Not
trying to show off by writting code that is not immediatly obvious. If
it needs any comments to describe it - then you are a useless
programmer.

The Grand Master
RobinS wrote:
You mean, "Harder for MasterProgrammer to read."
Robin S.
---------------------------------
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
Dec 4 '06 #17
you guys are full of shit

'managing handlers' is unnecessary complexity

Blake wrote:
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
Dec 4 '06 #18
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
Dec 4 '06 #19
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Hi Blake:

I also prefer the AddHandler syntax and for the same reason you mention.
I find it more readable, more flexible and less ambiguous. One should
never mix the styles and I'd have the "Handles" code reworked if somebody
submitted them to me.
I'm not sure that would be a good idea. The handles keyword supports the
designer where I presume the AddHandler does not.

Michael
Dec 4 '06 #20
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Good programming is about leaving breadcrumbs for the next person. Not
trying to show off by writting code that is not immediatly obvious. If
it needs any comments to describe it - then you are a useless
programmer.
Hardly. I'd say if it needs comments to describe it and those comments are
missing then you're a sloppy programmer.

Michael
Dec 4 '06 #21
I think that the VB.net method is much more verbose and riduclous

-Aaron


RobinS wrote:
You mean, "Harder for MasterProgrammer to read."
Robin S.
---------------------------------
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
Dec 4 '06 #22
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#

Someone at MS (rightly) assumed that handlers would be too conceptually
hard for some VB programmers. I guess they were right.

You just keep handling your button clicks and leave the real coding to
the professionals :-)

db*******@hotmail.com wrote:
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
Blake,
>
You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).
>
Cor
>
"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:

private button1 as new button

AddHandler button1.Click , AddressOf Click

' add the button to a form...

...

Private Sub Click(sender as Object, e as EventArgs)

MessageBox("Hello World!")

End Sub

Esentially the Handles keyword is wiring the event delegates for you.
That is all.







Cor Ligthert [MVP] wrote:
Strange: although I use both languages do I find especially the handling
of
handlers very weak in C#.
>
Cor
>
"Michael C" <no****@nospam.comschreef in bericht
news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Which do you prefer?
>
Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

I prefer the c# version :-)

>

Dec 5 '06 #23

"Michael C" <no****@nospam.comwrote in message
news:Ow**************@TK2MSFTNGP06.phx.gbl...
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>Hi Blake:

I also prefer the AddHandler syntax and for the same reason you mention.
I find it more readable, more flexible and less ambiguous. One should
never mix the styles and I'd have the "Handles" code reworked if somebody
submitted them to me.

I'm not sure that would be a good idea. The handles keyword supports the
designer where I presume the AddHandler does not.

Michael
What do you mean by that? You mean the designer, in terms of
double-clicking on the button to create the framework of
the event, or using the dropdowns?

Robin S.
Dec 5 '06 #24
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:S6******************************@comcast.com. ..
What do you mean by that? You mean the designer, in terms of
double-clicking on the button to create the framework of
the event, or using the dropdowns?
Either.

Michael
Dec 5 '06 #25
you're full of shit its not necessary it's too verbose
you're full of shit its not necessary it's too verbose
you're full of shit its not necessary it's too verbose


Blake 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#

Someone at MS (rightly) assumed that handlers would be too conceptually
hard for some VB programmers. I guess they were right.

You just keep handling your button clicks and leave the real coding to
the professionals :-)

db*******@hotmail.com wrote:
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)
>
I too prefer to manage handlers myself. Even in VB.
>
I guess I just like knowing as exactly as possible what is going on.
>
Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
Dec 5 '06 #26
if it takes 30% more verbosity for 80% of the stuff that i do; then by
definition-- it's not worth it.

-Aaron


Blake 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#

Someone at MS (rightly) assumed that handlers would be too conceptually
hard for some VB programmers. I guess they were right.

You just keep handling your button clicks and leave the real coding to
the professionals :-)

db*******@hotmail.com wrote:
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)
>
I too prefer to manage handlers myself. Even in VB.
>
I guess I just like knowing as exactly as possible what is going on.
>
Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style, the
plumbing is connected automatically for VB with the Handles keyword. In
C# you have to do the plumbing yourself with the equivelant of the
AddHandler command. You can do it youself in VB too, sometimes this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
Dec 5 '06 #27
Hi Michael:

I think you'll find it is a good idea. It isn't easy for me to explain and
it has a tendency to draw out the "my language is better than yours" folks.
But for some 25 years I have cautioned people against using language or
platform "unique" solutions. The definition of a language-unique feature
would be one that isn't (generally) found in other languages. So variables,
functions loops and conditional tests aren't unique and should be used.
Something like instantiating a variable upon first use (the opposite of
OPTION EXPLICIT) is uncommon and generally a bad practice so I caution
people to avoid it. Unique features make it harder to translate from or to
other languages. dBASE for instance had a CLEAR ALL command which was
"easy" in some people's eyes but horrible from the perspective of a software
developer.

In any case the AddHandler syntax permits you to disable handlers, or to
change handlers at runtime and it is the mechanism used in C#. Similar
"handler-like" assignments are available in other languages but nothing but
VB.Net is going to have "Handles Button1.Click" type syntax. Reliance on
these types of things tends to lead to "VB programmers" instead of
programmers who use VB.

Your mileage may vary...

Tom
"Michael C" <no****@nospam.comwrote in message
news:Ow**************@TK2MSFTNGP06.phx.gbl...
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>Hi Blake:

I also prefer the AddHandler syntax and for the same reason you mention.
I find it more readable, more flexible and less ambiguous. One should
never mix the styles and I'd have the "Handles" code reworked if somebody
submitted them to me.

I'm not sure that would be a good idea. The handles keyword supports the
designer where I presume the AddHandler does not.

Michael

Dec 5 '06 #28
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:e2**************@TK2MSFTNGP05.phx.gbl...
In any case the AddHandler syntax permits you to disable handlers, or to
change handlers at runtime and it is the mechanism used in C#. Similar
"handler-like" assignments are available in other languages but nothing
but VB.Net is going to have "Handles Button1.Click" type syntax. Reliance
on these types of things tends to lead to "VB programmers" instead of
programmers who use VB.

Your mileage may vary...
You have an excellent point and agree in the majority of cases but not sure
about this one. There is extra work involved and I think it would be a
hassle not using the designer for events. I presume you can't double click
buttons to go to the code it executes and have to find this code manually.
It might not even be called buttonName_Click so you'd have to find the
AddHandler first. There's also the problem that it would be very easy to
accidentally add the event twice by double clicking a control. Basically
you're missing out on a large amount of functionality and adding some hassle
just to avoid a language specific keyword that would be very easy to
translate should the need arise.

It might just be easier to use C#. Using AddHandler in vb seems to me like a
programmer who wants to use c# but can't or won't for some reason :-)

Michael
Dec 5 '06 #29
Michael,

You know that it is more work to remove a method with handler in C# than in
VB.Net?

Cor

"Michael C" <no****@nospam.comschreef in bericht
news:OJ*************@TK2MSFTNGP06.phx.gbl...
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:e2**************@TK2MSFTNGP05.phx.gbl...
>In any case the AddHandler syntax permits you to disable handlers, or to
change handlers at runtime and it is the mechanism used in C#. Similar
"handler-like" assignments are available in other languages but nothing
but VB.Net is going to have "Handles Button1.Click" type syntax.
Reliance on these types of things tends to lead to "VB programmers"
instead of programmers who use VB.

Your mileage may vary...

You have an excellent point and agree in the majority of cases but not
sure about this one. There is extra work involved and I think it would be
a hassle not using the designer for events. I presume you can't double
click buttons to go to the code it executes and have to find this code
manually. It might not even be called buttonName_Click so you'd have to
find the AddHandler first. There's also the problem that it would be very
easy to accidentally add the event twice by double clicking a control.
Basically you're missing out on a large amount of functionality and adding
some hassle just to avoid a language specific keyword that would be very
easy to translate should the need arise.

It might just be easier to use C#. Using AddHandler in vb seems to me like
a programmer who wants to use c# but can't or won't for some reason :-)

Michael

Dec 5 '06 #30
You can't double click the button and get to anything but the "Click"
handler can you? There are all sorts of handlers one could potentially want
to reference.

But it is much more than simply a matter of easier... as I pointed out the
Handles syntax isn't dynamic and can't be made dynamic. It is a simple
matter to point multiple controls (or events) to a single handler using
AddHandler() And it most likely isn't named buttonName_Click()... I don't
program "click handlers" I develop functionality which happens to execute
when a button is clicked. This gives one the flexibility to reassign the
handler to a different button or even a different non-button control.

It isn't about being a C# wannabe... C# is a case-sensitive language that
uses curly braces to delimit blocks of code and semicolons as line
terminators. I don't see any advantage to a case-sensitive language.

In any case I think you should continue to use the syntax you're happiest
with and I'll do the same :-)

Nice chatting with you.
Tom

"Michael C" <no****@nospam.comwrote in message
news:OJ*************@TK2MSFTNGP06.phx.gbl...
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:e2**************@TK2MSFTNGP05.phx.gbl...
>In any case the AddHandler syntax permits you to disable handlers, or to
change handlers at runtime and it is the mechanism used in C#. Similar
"handler-like" assignments are available in other languages but nothing
but VB.Net is going to have "Handles Button1.Click" type syntax.
Reliance on these types of things tends to lead to "VB programmers"
instead of programmers who use VB.

Your mileage may vary...

You have an excellent point and agree in the majority of cases but not
sure about this one. There is extra work involved and I think it would be
a hassle not using the designer for events. I presume you can't double
click buttons to go to the code it executes and have to find this code
manually. It might not even be called buttonName_Click so you'd have to
find the AddHandler first. There's also the problem that it would be very
easy to accidentally add the event twice by double clicking a control.
Basically you're missing out on a large amount of functionality and adding
some hassle just to avoid a language specific keyword that would be very
easy to translate should the need arise.

It might just be easier to use C#. Using AddHandler in vb seems to me like
a programmer who wants to use c# but can't or won't for some reason :-)

Michael

Dec 5 '06 #31
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP06.phx.gbl...
Michael,

You know that it is more work to remove a method with handler in C# than
in VB.Net?
Yes that is true, however it is only a small amount of extra work and
impossible to forget as it gives a compile error.

Michael
Dec 5 '06 #32
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:us*************@TK2MSFTNGP06.phx.gbl...
You can't double click the button and get to anything but the "Click"
handler can you?
No, but you can use the designer to get to other events by clicking on the
event tab (I presume vb has this?). Double clicking will only ever get the
default event, which in most cases is good enough, but with the designer
event window you can see all the events.
But it is much more than simply a matter of easier... as I pointed out the
Handles syntax isn't dynamic and can't be made dynamic.
In the rare case you need it to be dynamic (and these cases are quite rare)
then don't use the Handles keyword.
It is a simple matter to point multiple controls (or events) to a single
handler using AddHandler()
You can also do the same thing in the designer.
It isn't about being a C# wannabe... C# is a case-sensitive language that
uses curly braces to delimit blocks of code and semicolons as line
terminators. I don't see any advantage to a case-sensitive language.
I don't use the case-sensitivity but there are many other reasons to use it
and none of the items you've listed here are reasons not to use it.
In any case I think you should continue to use the syntax you're happiest
with and I'll do the same :-)

Nice chatting with you.
Oh, ok, see ya tom :-)

Michael
Dec 5 '06 #33
I guess I don't mind using the Handles if there's not
a pattern to it. For example, if I wanted to hook up
the MouseEnter and MouseLeave event for all the textboxes
on the screen, then I'd use a loop and AddHandler.
But for one button's click event, I'd do the Handles
thing. Oh, dear, that means I'm mixing methods.

Robin S.
----------------------------
"Michael C" <no****@nospam.comwrote in message
news:ua**************@TK2MSFTNGP03.phx.gbl...
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:S6******************************@comcast.com. ..
>What do you mean by that? You mean the designer, in terms of
double-clicking on the button to create the framework of
the event, or using the dropdowns?

Either.

Michael

Dec 5 '06 #34
I don't really see that it adds verbosity in terms of typing,
since if you double-click on the button, or use the dropdowns
in Visual Studio, it creates the framework of event code for you.
Mathematically speaking, I believe that's an even match -- 50%/50%.

Robin S.
-----------------------------------
<aa*********@gmail.comwrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
if it takes 30% more verbosity for 80% of the stuff that i do; then by
definition-- it's not worth it.

-Aaron


Blake 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#

Someone at MS (rightly) assumed that handlers would be too conceptually
hard for some VB programmers. I guess they were right.

You just keep handling your button clicks and leave the real coding to
the professionals :-)

db*******@hotmail.com wrote:
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)

I too prefer to manage handlers myself. Even in VB.

I guess I just like knowing as exactly as possible what is going on.

Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style,
the
plumbing is connected automatically for VB with the Handles
keyword. In
C# you have to do the plumbing yourself with the equivelant of
the
AddHandler command. You can do it youself in VB too, sometimes
this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for
you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the
>handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in
message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object,
>ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>

Dec 5 '06 #35
fully agree tom

I just don't want to be on the losing side of this argument.. if 90% of
the .NET programmers use C# then what are we doing here?

I just think that MS dealt us a raw deal; and I'm not willing to invest
my time in a new Microsoft-centric language.

I would rather use the old one-- than spend years gettign up to speed
only to find out that MS has killed the language after all.

I listened to rumors about MS Access for the past 10-15 years; and I
refuse to invest in an uncertain language again.

until Microsoft restores the 'VISUAL' and the word 'BASIC' to my
langauge they can lick my nuts

-Aaron

Tom Leylan wrote:
You can't double click the button and get to anything but the "Click"
handler can you? There are all sorts of handlers one could potentially want
to reference.

But it is much more than simply a matter of easier... as I pointed out the
Handles syntax isn't dynamic and can't be made dynamic. It is a simple
matter to point multiple controls (or events) to a single handler using
AddHandler() And it most likely isn't named buttonName_Click()... I don't
program "click handlers" I develop functionality which happens to execute
when a button is clicked. This gives one the flexibility to reassign the
handler to a different button or even a different non-button control.

It isn't about being a C# wannabe... C# is a case-sensitive language that
uses curly braces to delimit blocks of code and semicolons as line
terminators. I don't see any advantage to a case-sensitive language.

In any case I think you should continue to use the syntax you're happiest
with and I'll do the same :-)

Nice chatting with you.
Tom

"Michael C" <no****@nospam.comwrote in message
news:OJ*************@TK2MSFTNGP06.phx.gbl...
"Tom Leylan" <ge*@iamtiredofspam.comwrote in message
news:e2**************@TK2MSFTNGP05.phx.gbl...
In any case the AddHandler syntax permits you to disable handlers, or to
change handlers at runtime and it is the mechanism used in C#. Similar
"handler-like" assignments are available in other languages but nothing
but VB.Net is going to have "Handles Button1.Click" type syntax.
Reliance on these types of things tends to lead to "VB programmers"
instead of programmers who use VB.

Your mileage may vary...
You have an excellent point and agree in the majority of cases but not
sure about this one. There is extra work involved and I think it would be
a hassle not using the designer for events. I presume you can't double
click buttons to go to the code it executes and have to find this code
manually. It might not even be called buttonName_Click so you'd have to
find the AddHandler first. There's also the problem that it would be very
easy to accidentally add the event twice by double clicking a control.
Basically you're missing out on a large amount of functionality and adding
some hassle just to avoid a language specific keyword that would be very
easy to translate should the need arise.

It might just be easier to use C#. Using AddHandler in vb seems to me like
a programmer who wants to use c# but can't or won't for some reason :-)

Michael
Dec 5 '06 #36

<aa*********@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
>
I just don't want to be on the losing side of this argument..
Too late!

Robin S.
Dec 5 '06 #37
I don't care if the wizard generates the code.

it shouldn't be visible.. all it is, is that it's unnecessary and too
much work.

extra work + more extra work + no added benefits <50% / 50%

it's time to put the VISUAL and the BASIC back into VB

-Aaron


RobinS wrote:
I don't really see that it adds verbosity in terms of typing,
since if you double-click on the button, or use the dropdowns
in Visual Studio, it creates the framework of event code for you.
Mathematically speaking, I believe that's an even match -- 50%/50%.

Robin S.
-----------------------------------
<aa*********@gmail.comwrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
if it takes 30% more verbosity for 80% of the stuff that i do; then by
definition-- it's not worth it.

-Aaron


Blake 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#

Someone at MS (rightly) assumed that handlers would be too conceptually
hard for some VB programmers. I guess they were right.

You just keep handling your button clicks and leave the real coding to
the professionals :-)

db*******@hotmail.com wrote:
I mean seriously here

'mybutton_click' in vb6?

it all used to be automagic.

I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton

any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
Blake wrote:
Yes. Thats what I was pointing out :-)
>
I too prefer to manage handlers myself. Even in VB.
>
I guess I just like knowing as exactly as possible what is going on.
>
Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style,
the
plumbing is connected automatically for VB with the Handles
keyword. In
C# you have to do the plumbing yourself with the equivelant of
the
AddHandler command. You can do it youself in VB too, sometimes
this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for
you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the
>handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in
message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object,
>ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
Dec 5 '06 #38
people never look up to Junior Programmers aka VB.net wannabes

-Aaron

guy wrote:
people never look up to people who look down on them

"Master Programmer" wrote:
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
Dec 5 '06 #39
Plenty of people look up to me :D
__________________________________
Grim
(Lead Engineer/HMI Technical Specialist/.NET Programmer)

<aa*********@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
people never look up to Junior Programmers aka VB.net wannabes

-Aaron

guy wrote:
>people never look up to people who look down on them

"Master Programmer" wrote:
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub


Dec 5 '06 #40
yeah like retarded VB.net wannabes.

I heard that VB.net is going away
even if it's not C# is 5 times as popular

-Aaron

The Grim Reaper wrote:
Plenty of people look up to me :D
__________________________________
Grim
(Lead Engineer/HMI Technical Specialist/.NET Programmer)

<aa*********@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
people never look up to Junior Programmers aka VB.net wannabes

-Aaron

guy wrote:
people never look up to people who look down on them

"Master Programmer" wrote:

Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer" <master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
Dec 5 '06 #41
What makes you persist eh?? LOL.

FYI: There are no other VB/VB.NET/.NET/whatever you refer to it as/VBA or C#
programmers in the entire company...

I heard that you were going away. Unfortunately someone made that up too.

To clarify: I'm a .NET programmer - not VB.NET - I don't import the
Microsoft.VisualBasic namespace.
If I want to use VB, I use VB6.
___________________________________
The Grimch

<aa*********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
yeah like retarded VB.net wannabes.

I heard that VB.net is going away
even if it's not C# is 5 times as popular

-Aaron

The Grim Reaper wrote:
>Plenty of people look up to me :D
__________________________________
Grim
(Lead Engineer/HMI Technical Specialist/.NET Programmer)

<aa*********@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegr oups.com...
people never look up to Junior Programmers aka VB.net wannabes

-Aaron

guy wrote:
people never look up to people who look down on them

"Master Programmer" wrote:

Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down
at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer"
<master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub

What do you prefer?

Classic VB example:
*************************

Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub

Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click,
Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub

Dec 5 '06 #42
Anyone who has been working with .Net long enough should easily be able
to read both C# .NET and VB.NET anyway. If the code is written poorly
it won't matter whether it has Handles keywords or does all the hooks
by hand, it will still be bad code. Pick which flavor you like and get
rockin...

The Grim Reaper wrote:
What makes you persist eh?? LOL.

FYI: There are no other VB/VB.NET/.NET/whatever you refer to it as/VBA or C#
programmers in the entire company...

I heard that you were going away. Unfortunately someone made that up too.

To clarify: I'm a .NET programmer - not VB.NET - I don't import the
Microsoft.VisualBasic namespace.
If I want to use VB, I use VB6.
___________________________________
The Grimch

<aa*********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
yeah like retarded VB.net wannabes.

I heard that VB.net is going away
even if it's not C# is 5 times as popular

-Aaron

The Grim Reaper wrote:
Plenty of people look up to me :D
__________________________________
Grim
(Lead Engineer/HMI Technical Specialist/.NET Programmer)

<aa*********@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
people never look up to Junior Programmers aka VB.net wannabes

-Aaron

guy wrote:
people never look up to people who look down on them

"Master Programmer" wrote:

Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down
at
everyone."
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer"
<master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click,
Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub

Dec 5 '06 #43
lick my nuts, Charlie

compatability with C# is NOT a benefit of VB

C# is a fucking disease and the motherfucker who coninced MS to invent
a new language-- instead of taking VB 2002 seriously-- should be drawn
and quartered on live TV.

of course; it's a dead issue now.. C# has won the war... so now MS is
going to kill off VB.net sometime soon.

-Aaron
Charlie Brown wrote:
Anyone who has been working with .Net long enough should easily be able
to read both C# .NET and VB.NET anyway. If the code is written poorly
it won't matter whether it has Handles keywords or does all the hooks
by hand, it will still be bad code. Pick which flavor you like and get
rockin...

The Grim Reaper wrote:
What makes you persist eh?? LOL.

FYI: There are no other VB/VB.NET/.NET/whatever you refer to it as/VBA or C#
programmers in the entire company...

I heard that you were going away. Unfortunately someone made that up too.

To clarify: I'm a .NET programmer - not VB.NET - I don't import the
Microsoft.VisualBasic namespace.
If I want to use VB, I use VB6.
___________________________________
The Grimch

<aa*********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
yeah like retarded VB.net wannabes.
>
I heard that VB.net is going away
even if it's not C# is 5 times as popular
>
-Aaron
>
>
>
The Grim Reaper wrote:
>Plenty of people look up to me :D
>__________________________________
>Grim
>(Lead Engineer/HMI Technical Specialist/.NET Programmer)
>>
><aa*********@gmail.comwrote in message
>news:11**********************@f1g2000cwa.googlegr oups.com...
people never look up to Junior Programmers aka VB.net wannabes
>
-Aaron
>
>
>
guy wrote:
>people never look up to people who look down on them
>>
>>
>>
>"Master Programmer" wrote:
>>
Harder to read
>
The Grand Master
"When you have climbed to the top of the mountain you can look down
at
everyone."
>
>
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer"
<master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click,
Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
>
>
>
>
Dec 6 '06 #44
Totaly true, who the fuck wants that other garbage to look at. Couldn't
have put it better myself Aaron.
The Grand Master
"When you have reached the top of the mountain
you can look down at everyone else."
aa*********@gmail.com wrote:
I don't care if the wizard generates the code.

it shouldn't be visible.. all it is, is that it's unnecessary and too
much work.

extra work + more extra work + no added benefits <50% / 50%

it's time to put the VISUAL and the BASIC back into VB

-Aaron


RobinS wrote:
I don't really see that it adds verbosity in terms of typing,
since if you double-click on the button, or use the dropdowns
in Visual Studio, it creates the framework of event code for you.
Mathematically speaking, I believe that's an even match -- 50%/50%.

Robin S.
-----------------------------------
<aa*********@gmail.comwrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
if it takes 30% more verbosity for 80% of the stuff that i do; then by
definition-- it's not worth it.
>
-Aaron
>
>
>
>
Blake 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#
>>
>Someone at MS (rightly) assumed that handlers would be too conceptually
>hard for some VB programmers. I guess they were right.
>>
>You just keep handling your button clicks and leave the real coding to
>the professionals :-)
>>
>db*******@hotmail.com wrote:
I mean seriously here
>
'mybutton_click' in vb6?
>
it all used to be automagic.
>
I shouldn't ever need to change these.. mybutton_click should HANDLE
the CLICK event of mybutton
>
any other LOAD OF CRAP that you shove down my throat is going to be
responded to as 'VB.NET IS NOT TOO VERBOSE'
>
>
Blake wrote:
Yes. Thats what I was pointing out :-)
>
I too prefer to manage handlers myself. Even in VB.
>
I guess I just like knowing as exactly as possible what is going on.
>
Cor Ligthert [MVP] wrote:
Blake,

You can use the C# style in VB.Net in the same way, however you get
something extra in VB.Net, which is in my opinion in fact nicer as
documentation. (Although I use often the C# way in VB.Net).

Cor

"Blake" <bl***@zgeek.comschreef in bericht
news:11**********************@16g2000cwy.googlegro ups.com...
Handlers are not weak in C#. It's just that, in typical vb style,
the
plumbing is connected automatically for VB with the Handles
keyword. In
C# you have to do the plumbing yourself with the equivelant of
the
AddHandler command. You can do it youself in VB too, sometimes
this is
an advantage. ie:
>
private button1 as new button
>
AddHandler button1.Click , AddressOf Click
>
' add the button to a form...
>
...
>
Private Sub Click(sender as Object, e as EventArgs)
>
MessageBox("Hello World!")
>
End Sub
>
Esentially the Handles keyword is wiring the event delegates for
you.
That is all.
>
>
>
>
>
>
>
Cor Ligthert [MVP] wrote:
>Strange: although I use both languages do I find especially the
>handling
>of
>handlers very weak in C#.
>>
>Cor
>>
>"Michael C" <no****@nospam.comschreef in bericht
>news:OC**************@TK2MSFTNGP05.phx.gbl...
"Master Programmer" <ma***************@outgun.comwrote in
message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Which do you prefer?
>>
>Classic VB example:
>*************************
>Private Sub Command1_Click()
> MsgBox "Hello, World"
>End Sub
>>
>A VB.NET example:
>**************************
>Private Sub Button1_Click(ByVal sender As System.Object,
>ByVal e As
>System.EventArgs) Handles Button1.Click
> MessageBox.Show("Hello, World")
>End Sub
>
I prefer the c# version :-)
>
>>
>
>
>
>
Dec 6 '06 #45
On 2006-12-05, Blake <bl***@zgeek.comwrote:
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
Dec 6 '06 #46
I use VB.NET BTW... and I wasn't talking about compatibility, I was
referring to readability. It's like any spoken language, they have the
same meaning just different symbols and words to get there. Who cares
if someone speaks German, Italian, or English? What matters is the
association the words represent. You can do the same thing in both
languages, who cares HOW you do it.
aa*********@gmail.com wrote:
lick my nuts, Charlie

compatability with C# is NOT a benefit of VB

C# is a fucking disease and the motherfucker who coninced MS to invent
a new language-- instead of taking VB 2002 seriously-- should be drawn
and quartered on live TV.

of course; it's a dead issue now.. C# has won the war... so now MS is
going to kill off VB.net sometime soon.

-Aaron
Charlie Brown wrote:
Anyone who has been working with .Net long enough should easily be able
to read both C# .NET and VB.NET anyway. If the code is written poorly
it won't matter whether it has Handles keywords or does all the hooks
by hand, it will still be bad code. Pick which flavor you like and get
rockin...

The Grim Reaper wrote:
What makes you persist eh?? LOL.
>
FYI: There are no other VB/VB.NET/.NET/whatever you refer to it as/VBA or C#
programmers in the entire company...
>
I heard that you were going away. Unfortunately someone made that up too.
>
To clarify: I'm a .NET programmer - not VB.NET - I don't import the
Microsoft.VisualBasic namespace.
If I want to use VB, I use VB6.
___________________________________
The Grimch
>
<aa*********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
yeah like retarded VB.net wannabes.

I heard that VB.net is going away
even if it's not C# is 5 times as popular

-Aaron



The Grim Reaper wrote:
Plenty of people look up to me :D
__________________________________
Grim
(Lead Engineer/HMI Technical Specialist/.NET Programmer)
>
<aa*********@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
people never look up to Junior Programmers aka VB.net wannabes

-Aaron



guy wrote:
people never look up to people who look down on them
>
>
>
"Master Programmer" wrote:
>
Harder to read

The Grand Master
"When you have climbed to the top of the mountain you can look down
at
everyone."


Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer"
<master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click,
Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub


Dec 6 '06 #47
you can't do the same thing in VB.net.

it's not practical.

do you know why?? because C# already got critical mass.. and MS doesn't
give a shit about VB anymore

-Aaron
Charlie Brown wrote:
I use VB.NET BTW... and I wasn't talking about compatibility, I was
referring to readability. It's like any spoken language, they have the
same meaning just different symbols and words to get there. Who cares
if someone speaks German, Italian, or English? What matters is the
association the words represent. You can do the same thing in both
languages, who cares HOW you do it.
aa*********@gmail.com wrote:
lick my nuts, Charlie

compatability with C# is NOT a benefit of VB

C# is a fucking disease and the motherfucker who coninced MS to invent
a new language-- instead of taking VB 2002 seriously-- should be drawn
and quartered on live TV.

of course; it's a dead issue now.. C# has won the war... so now MS is
going to kill off VB.net sometime soon.

-Aaron
Charlie Brown wrote:
Anyone who has been working with .Net long enough should easily be able
to read both C# .NET and VB.NET anyway. If the code is written poorly
it won't matter whether it has Handles keywords or does all the hooks
by hand, it will still be bad code. Pick which flavor you like and get
rockin...
>
The Grim Reaper wrote:
What makes you persist eh?? LOL.

FYI: There are no other VB/VB.NET/.NET/whatever you refer to it as/VBA or C#
programmers in the entire company...

I heard that you were going away. Unfortunately someone made that up too.

To clarify: I'm a .NET programmer - not VB.NET - I don't import the
Microsoft.VisualBasic namespace.
If I want to use VB, I use VB6.
___________________________________
The Grimch

<aa*********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
yeah like retarded VB.net wannabes.
>
I heard that VB.net is going away
even if it's not C# is 5 times as popular
>
-Aaron
>
>
>
The Grim Reaper wrote:
>Plenty of people look up to me :D
>__________________________________
>Grim
>(Lead Engineer/HMI Technical Specialist/.NET Programmer)
>>
><aa*********@gmail.comwrote in message
>news:11**********************@f1g2000cwa.googlegr oups.com...
people never look up to Junior Programmers aka VB.net wannabes
>
-Aaron
>
>
>
guy wrote:
>people never look up to people who look down on them
>>
>>
>>
>"Master Programmer" wrote:
>>
Harder to read
>
The Grand Master
"When you have climbed to the top of the mountain you can look down
at
everyone."
>
>
Blake wrote:
On Dec 4, 1:24 pm, "Master Programmer"
<master_program...@outgun.com>
wrote:
Which do you prefer?

Classic VB example:
*************************
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub

A VB.NET example:
**************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
>
What do you prefer?
>
Classic VB example:
*************************
>
Private Sub Command1_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command2_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command3_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command4_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command5_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command6_Click()
MsgBox "Hello, World"
End Sub
>
Private Sub Command7_Click()
MsgBox "Hello, World"
End Sub
>
A VB.NET example:
**************************
>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click,
Button4.Click,
Button5.Click, Button6.Click, Button7.Click,
MessageBox.Show("Hello, World")
End Sub
>
>
>
>
Dec 6 '06 #48
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

"Tom Shelton" <to*********@comcastXXXXXXX.netschreef in bericht
news:ef******************************@comcast.com. ..
On 2006-12-05, Blake <bl***@zgeek.comwrote:
>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

Dec 6 '06 #49
No code should EVER need one single comment if it is written properly.
It should be easy to follow without ANY explanation needed. If your
code needs comments to describe it then I suggest you go back to
school.

The Grand Master
Michael C wrote:
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Good programming is about leaving breadcrumbs for the next person. Not
trying to show off by writting code that is not immediatly obvious. If
it needs any comments to describe it - then you are a useless
programmer.

Hardly. I'd say if it needs comments to describe it and those comments are
missing then you're a sloppy programmer.

Michael
Dec 7 '06 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kenneth McDonald | last post by:
I'm looking for a Wiki engine to set up for my company, so that we can incrementally add user documentation for a fairly complex program, plus allow users to add their own comments for the benefit...
4
by: Support | last post by:
Hi, I want to know if I have changed a few records in my database using update / insert / delete methods, how can i later know which rows have been changed or modified ? I know the...
3
by: Unforgiven | last post by:
I have the following situation: Given this class: template<typename T> class Expression { /* omitted */ }; This is the base class for a BooleanExpression and an ArithmeticExpression.
106
by: cfmortgagepro | last post by:
Hi, I know that I'm an extreme newb by asking this overly beaten question, but I am leaning toward C#, becuase the perception is that it is better to learn than VB.Net. I guess it makes you...
11
by: l.woods | last post by:
I want to set up my CATCH for a specific exception, but I really don't know which one of the multitude that it is. I am getting the exception now with Catch ex as Exception but I want to be...
20
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.