Home All Groups Group Topic Archive Search About
Author
4 Dec 2006 2:24 AM
Master Programmer
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

Author
4 Dec 2006 2:34 AM
Stephany Young
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.


Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165199087.491438.325360@j44g2000cwa.googlegroups.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
>
Author
4 Dec 2006 2:45 AM
Blake
Show quote Hide quote
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
Author
4 Dec 2006 3:29 AM
Michael C
Show quote Hide quote
"Blake" <bl***@zgeek.com> wrote in message
news:1165200305.407420.9910@l12g2000cwl.googlegroups.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
Author
4 Dec 2006 4:43 AM
Cor Ligthert [MVP]
Blake,

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

Cor

Show quoteHide quote
"Blake" <bl***@zgeek.com> schreef in bericht
news:1165200305.407420.9910@l12g2000cwl.googlegroups.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
>
Author
4 Dec 2006 9:32 AM
Master Programmer
Harder to read

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


Blake wrote:
Show quoteHide quote
> 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
Author
4 Dec 2006 5:54 PM
RobinS
You mean, "Harder for MasterProgrammer to read."


Robin S.
---------------------------------
Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165224730.183959.130070@j72g2000cwa.googlegroups.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
>
Author
4 Dec 2006 10:52 PM
Master Programmer
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:
Show quoteHide quote
> You mean, "Harder for MasterProgrammer to read."
>
>
> Robin S.
> ---------------------------------
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165224730.183959.130070@j72g2000cwa.googlegroups.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
> >
Author
4 Dec 2006 11:09 PM
Michael C
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
Author
7 Dec 2006 1:45 AM
Master Programmer
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:
Show quoteHide quote
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
Author
7 Dec 2006 2:17 AM
Tim Patrick
While I always recommend adding comments, it might be true that in business
programming many comments are only there for "backup purposes." But not all
programming is of a business nature. I once worked at a company that was
developing a PowerPoint-type program for a non-Windows platform. The main
programmer was in his 50s and had something like two PhD's in advanced physics,
etc. He was coding algorithms for 3D slide-transition animations in his head.
Wow!

In one of the transitions, the user could enable a colored border around
the slide that was entering or leaving, a slide that was flipping this way
and that way. There was a bug in the transition that caused the border to
draw incorrectly at certain angles. Guess who's job it became to fix the
bug. (Me.) Guess who didn't add any comments to his source code. (Mr. Genius
PhD.) Guess who had a really hard time fixing the bug. (That would be me,
again.) I decided that day to never write a program devoid of comments.

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005

Show quoteHide quote
> 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" <master_program***@outgun.com> wrote in message
>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>
Author
7 Dec 2006 4:50 AM
RobinS
I don't agree. I've written some really complicated programs
with complex statistical calculations, and I always put
in comments, if not for the poor guy who comes after me, then
for me 6 months later when I'm no longer working on it, and I
have to go back and fix it. It's been 2 years since I left
that software behind, and I still get e-mails thanking me for
documenting my code so well.

Robin S.
----------------------------------
Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
> 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" <master_program***@outgun.com> wrote in message
>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>
Author
7 Dec 2006 5:05 AM
Cor Ligthert [MVP]
Tim and Robin,

Do you know what is the trouble with me.

I can always better read code than even my own in any language written
comments.

Beside me I have seen that most developers are not given with rich
possibilities to write comments (and to tell something you can disagree with
me; I have seen that those who are able to write very nice comments often
make very bad code).

Just my thought,

:-)

Cor

Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>I don't agree. I've written some really complicated programs
> with complex statistical calculations, and I always put
> in comments, if not for the poor guy who comes after me, then
> for me 6 months later when I'm no longer working on it, and I
> have to go back and fix it. It's been 2 years since I left
> that software behind, and I still get e-mails thanking me for
> documenting my code so well.
>
> Robin S.
> ----------------------------------
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>> 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" <master_program***@outgun.com> wrote in message
>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>
>
>
Author
7 Dec 2006 5:53 AM
RobinS
I understand what you're saying. I'm not talking about comments
like this:

    'define a variable to hold the count
    Dim count as Integer

I'm talking about comments like this, that explain something out of
the ordinary, or explain *why* something is done a particular way:

    'routine X seems like the logical place to put this instead
    '  of here in routine Y, but if you put it there instead of
    '  here, the dire consequences will be this
    '  (insert dire consequences). So even though this
    '  seems counterintuitive, don't move it. You'll regret it.
    (seemingly oddly-placed code)

Robin S.
---------------------
Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
> Tim and Robin,
>
> Do you know what is the trouble with me.
>
> I can always better read code than even my own in any language written
> comments.
>
> Beside me I have seen that most developers are not given with rich
> possibilities to write comments (and to tell something you can disagree
> with me; I have seen that those who are able to write very nice comments
> often make very bad code).
>
> Just my thought,
>
> :-)
>
> Cor
>
> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>I don't agree. I've written some really complicated programs
>> with complex statistical calculations, and I always put
>> in comments, if not for the poor guy who comes after me, then
>> for me 6 months later when I'm no longer working on it, and I
>> have to go back and fix it. It's been 2 years since I left
>> that software behind, and I still get e-mails thanking me for
>> documenting my code so well.
>>
>> Robin S.
>> ----------------------------------
>> "Master Programmer" <master_program***@outgun.com> wrote in message
>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>> 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" <master_program***@outgun.com> wrote in message
>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>
>>
>>
>
>
Author
7 Dec 2006 6:00 AM
Master Programmer
Why name it X or Y. Surely a variable named "loop_Counter" or
"array_Count" or "employee_Split" would be more intuative.

The Grand Master


RobinS wrote:
Show quoteHide quote
> I understand what you're saying. I'm not talking about comments
> like this:
>
>     'define a variable to hold the count
>     Dim count as Integer
>
> I'm talking about comments like this, that explain something out of
> the ordinary, or explain *why* something is done a particular way:
>
>     'routine X seems like the logical place to put this instead
>     '  of here in routine Y, but if you put it there instead of
>     '  here, the dire consequences will be this
>     '  (insert dire consequences). So even though this
>     '  seems counterintuitive, don't move it. You'll regret it.
>     (seemingly oddly-placed code)
>
> Robin S.
> ---------------------
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
> > Tim and Robin,
> >
> > Do you know what is the trouble with me.
> >
> > I can always better read code than even my own in any language written
> > comments.
> >
> > Beside me I have seen that most developers are not given with rich
> > possibilities to write comments (and to tell something you can disagree
> > with me; I have seen that those who are able to write very nice comments
> > often make very bad code).
> >
> > Just my thought,
> >
> > :-)
> >
> > Cor
> >
> > "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
> > news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
> >>I don't agree. I've written some really complicated programs
> >> with complex statistical calculations, and I always put
> >> in comments, if not for the poor guy who comes after me, then
> >> for me 6 months later when I'm no longer working on it, and I
> >> have to go back and fix it. It's been 2 years since I left
> >> that software behind, and I still get e-mails thanking me for
> >> documenting my code so well.
> >>
> >> Robin S.
> >> ----------------------------------
> >> "Master Programmer" <master_program***@outgun.com> wrote in message
> >> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
> >>> 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" <master_program***@outgun.com> wrote in message
> >>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
> >>>
> >>
> >>
> >
> >
Author
7 Dec 2006 7:10 AM
RobinS
Um, I don't name it X or Y, it's just an example. Please don't make
me look through the 50,000 lines of code in the last project I wrote
to find the perfect example.

Robin S.
--------------------------
Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165471215.692220.123680@73g2000cwn.googlegroups.com...
> Why name it X or Y. Surely a variable named "loop_Counter" or
> "array_Count" or "employee_Split" would be more intuative.
>
> The Grand Master
>
>
> RobinS wrote:
>> I understand what you're saying. I'm not talking about comments
>> like this:
>>
>>     'define a variable to hold the count
>>     Dim count as Integer
>>
>> I'm talking about comments like this, that explain something out of
>> the ordinary, or explain *why* something is done a particular way:
>>
>>     'routine X seems like the logical place to put this instead
>>     '  of here in routine Y, but if you put it there instead of
>>     '  here, the dire consequences will be this
>>     '  (insert dire consequences). So even though this
>>     '  seems counterintuitive, don't move it. You'll regret it.
>>     (seemingly oddly-placed code)
>>
>> Robin S.
>> ---------------------
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>> > Tim and Robin,
>> >
>> > Do you know what is the trouble with me.
>> >
>> > I can always better read code than even my own in any language written
>> > comments.
>> >
>> > Beside me I have seen that most developers are not given with rich
>> > possibilities to write comments (and to tell something you can disagree
>> > with me; I have seen that those who are able to write very nice
>> > comments
>> > often make very bad code).
>> >
>> > Just my thought,
>> >
>> > :-)
>> >
>> > Cor
>> >
>> > "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>> > news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>> >>I don't agree. I've written some really complicated programs
>> >> with complex statistical calculations, and I always put
>> >> in comments, if not for the poor guy who comes after me, then
>> >> for me 6 months later when I'm no longer working on it, and I
>> >> have to go back and fix it. It's been 2 years since I left
>> >> that software behind, and I still get e-mails thanking me for
>> >> documenting my code so well.
>> >>
>> >> Robin S.
>> >> ----------------------------------
>> >> "Master Programmer" <master_program***@outgun.com> wrote in message
>> >> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>> >>> 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" <master_program***@outgun.com> wrote in message
>> >>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>> >>>
>> >>
>> >>
>> >
>> >
>
Author
7 Dec 2006 6:21 AM
Cor Ligthert [MVP]
Robin,

Your particular comment suggest that the one who read it is able to
understand what you are saying.

In this case he needs some more than average knowledge of code to understand
why something is done. That one does not need your comment, he/she sees it
and thinks, whow I would not have done it that way, however according the
quality of the rest of the program the developer should have had a special
reason for that. Let me think twice and than probably sees the why.

For a beginner this kind of comments has no sense even with the comment they
don't understand it.

However again just my personal opinion.

In my opinion a good comment can be:
'See document xyz for an explanation of mathematics in the used code

Cor

Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
>I understand what you're saying. I'm not talking about comments
> like this:
>
>    'define a variable to hold the count
>    Dim count as Integer
>
> I'm talking about comments like this, that explain something out of
> the ordinary, or explain *why* something is done a particular way:
>
>    'routine X seems like the logical place to put this instead
>    '  of here in routine Y, but if you put it there instead of
>    '  here, the dire consequences will be this
>    '  (insert dire consequences). So even though this
>    '  seems counterintuitive, don't move it. You'll regret it.
>    (seemingly oddly-placed code)
>
> Robin S.
> ---------------------
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>> Tim and Robin,
>>
>> Do you know what is the trouble with me.
>>
>> I can always better read code than even my own in any language written
>> comments.
>>
>> Beside me I have seen that most developers are not given with rich
>> possibilities to write comments (and to tell something you can disagree
>> with me; I have seen that those who are able to write very nice comments
>> often make very bad code).
>>
>> Just my thought,
>>
>> :-)
>>
>> Cor
>>
>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>>I don't agree. I've written some really complicated programs
>>> with complex statistical calculations, and I always put
>>> in comments, if not for the poor guy who comes after me, then
>>> for me 6 months later when I'm no longer working on it, and I
>>> have to go back and fix it. It's been 2 years since I left
>>> that software behind, and I still get e-mails thanking me for
>>> documenting my code so well.
>>>
>>> Robin S.
>>> ----------------------------------
>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>>> 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" <master_program***@outgun.com> wrote in message
>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>>
>>>
>>>
>>
>>
>
>
Author
7 Dec 2006 7:18 AM
RobinS
It *does* help if he has more than average knowledge, but I
don't like to assume that whoever comes along behind me *does*.
Plus, why should the poor guy have to spend extra time figuring
it out, when I can just put in a comment for him?

Also, frequently it's a business-rule kind of thing, that's
not documented anywhere for the programmer. While I *love*
to get written business requirements from my clients, I rarely do.

The specs for the last application I wrote were in the form
of a bunch of fields written on a piece of paper torn out of
a spiral notebook with the instructions "These are in three
different applications that we use, can you please figure out
how to get only *our* data out of those applications, for
only these fields, and put them in a central repository for us?"

I like to leave external documentation behind with my finished
applications (in this case, I documented the database/table/fieldname,
and in most cases, the query used), but that's not always possible.

To each their own, I just like to leave a helping hand to
whoever comes along behind me. It only takes me a few seconds.
(I type 100+ wpm).

Robin S.
---------------------------------


Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:uGlJsecGHHA.2456@TK2MSFTNGP06.phx.gbl...
> Robin,
>
> Your particular comment suggest that the one who read it is able to
> understand what you are saying.
>
> In this case he needs some more than average knowledge of code to
> understand why something is done. That one does not need your comment,
> he/she sees it and thinks, whow I would not have done it that way, however
> according the quality of the rest of the program the developer should have
> had a special reason for that. Let me think twice and than probably sees
> the why.
>
> For a beginner this kind of comments has no sense even with the comment
> they don't understand it.
>
> However again just my personal opinion.
>
> In my opinion a good comment can be:
> 'See document xyz for an explanation of mathematics in the used code
>
> Cor
>
> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
> news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
>>I understand what you're saying. I'm not talking about comments
>> like this:
>>
>>    'define a variable to hold the count
>>    Dim count as Integer
>>
>> I'm talking about comments like this, that explain something out of
>> the ordinary, or explain *why* something is done a particular way:
>>
>>    'routine X seems like the logical place to put this instead
>>    '  of here in routine Y, but if you put it there instead of
>>    '  here, the dire consequences will be this
>>    '  (insert dire consequences). So even though this
>>    '  seems counterintuitive, don't move it. You'll regret it.
>>    (seemingly oddly-placed code)
>>
>> Robin S.
>> ---------------------
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>>> Tim and Robin,
>>>
>>> Do you know what is the trouble with me.
>>>
>>> I can always better read code than even my own in any language written
>>> comments.
>>>
>>> Beside me I have seen that most developers are not given with rich
>>> possibilities to write comments (and to tell something you can disagree
>>> with me; I have seen that those who are able to write very nice comments
>>> often make very bad code).
>>>
>>> Just my thought,
>>>
>>> :-)
>>>
>>> Cor
>>>
>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>>>I don't agree. I've written some really complicated programs
>>>> with complex statistical calculations, and I always put
>>>> in comments, if not for the poor guy who comes after me, then
>>>> for me 6 months later when I'm no longer working on it, and I
>>>> have to go back and fix it. It's been 2 years since I left
>>>> that software behind, and I still get e-mails thanking me for
>>>> documenting my code so well.
>>>>
>>>> Robin S.
>>>> ----------------------------------
>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>>>> 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" <master_program***@outgun.com> wrote in message
>>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
8 Dec 2006 4:24 PM
Tom Leylan
Robin:

How can we hope to have reasonable conversations when people are arguing
against comments.  I don't know where they work but I've seen millions of
lines of code and I'm sure each programmer thought the code was completely
clear when in fact it was plainly not.  What seems obvious as it is being
written won't be so obvious 3 years later when 8 of the original programmers
have quit.  But let's say I include a SSort() routine, would developers
recognize it as a "stable sort" just by reading the code?  I'll guess that
90% of the VB programmers haven't heard of a stable sort so how can they
recognize one?  I'll also guess "what a dork doesn't he know there is a sort
method" is what some of the folks here would say.

But that is only one use of comments.  They have been elevated in status
through the use of things like JavaDoc (in Java).  In large apps I've seen
3, 4 and 5 versions of "identical functionality" simply because none of the
programmers knew the other functions existed when they wrote their own local
version.  An automated system for producing printed documentation would go a
long way to reducing this stuff.

We also use them to track changes.  With business critical apps (and I mean
daily or weekly turnaround schedules) it is important to know what changed,
who changed it, when it was changed and why it was changed.  There is no
more sensible place to put this information than next to the code that
actually changed.  And if you made a undocumented modification and the $14
million a year client dropped the company because your change ruined their
system you can bet there would be repercussions.

They aren't fun, and the system isn't perfect but how on Earth can anybody
be arguing against commenting?  I suspect it's a game... the "your code is
inferior because you have to comment it" gambit.  But my code isn't inferior
it is as good or better and it has reasonable and useful comments as well.

These types of threads come about continually, it's part of the coming of
age of software developers.  I've had programmers (who "knew" they were the
greatest) tell me that programmers don't read documentation.  When I
challenged that statement he asked if I thought the majority of programmers
read the docs and I answered, "no not the majority, just the good ones."

Well that's my 2 cents... everybody carry on :-)



Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:Bo2dndYoUMupXerYnZ2dnUVZ_tqdnZ2d@comcast.com...
> It *does* help if he has more than average knowledge, but I
> don't like to assume that whoever comes along behind me *does*.
> Plus, why should the poor guy have to spend extra time figuring
> it out, when I can just put in a comment for him?
>
> Also, frequently it's a business-rule kind of thing, that's
> not documented anywhere for the programmer. While I *love*
> to get written business requirements from my clients, I rarely do.
>
> The specs for the last application I wrote were in the form
> of a bunch of fields written on a piece of paper torn out of
> a spiral notebook with the instructions "These are in three
> different applications that we use, can you please figure out
> how to get only *our* data out of those applications, for
> only these fields, and put them in a central repository for us?"
>
> I like to leave external documentation behind with my finished
> applications (in this case, I documented the database/table/fieldname,
> and in most cases, the query used), but that's not always possible.
>
> To each their own, I just like to leave a helping hand to
> whoever comes along behind me. It only takes me a few seconds.
> (I type 100+ wpm).
>
> Robin S.
> ---------------------------------
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:uGlJsecGHHA.2456@TK2MSFTNGP06.phx.gbl...
>> Robin,
>>
>> Your particular comment suggest that the one who read it is able to
>> understand what you are saying.
>>
>> In this case he needs some more than average knowledge of code to
>> understand why something is done. That one does not need your comment,
>> he/she sees it and thinks, whow I would not have done it that way,
>> however according the quality of the rest of the program the developer
>> should have had a special reason for that. Let me think twice and than
>> probably sees the why.
>>
>> For a beginner this kind of comments has no sense even with the comment
>> they don't understand it.
>>
>> However again just my personal opinion.
>>
>> In my opinion a good comment can be:
>> 'See document xyz for an explanation of mathematics in the used code
>>
>> Cor
>>
>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>> news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
>>>I understand what you're saying. I'm not talking about comments
>>> like this:
>>>
>>>    'define a variable to hold the count
>>>    Dim count as Integer
>>>
>>> I'm talking about comments like this, that explain something out of
>>> the ordinary, or explain *why* something is done a particular way:
>>>
>>>    'routine X seems like the logical place to put this instead
>>>    '  of here in routine Y, but if you put it there instead of
>>>    '  here, the dire consequences will be this
>>>    '  (insert dire consequences). So even though this
>>>    '  seems counterintuitive, don't move it. You'll regret it.
>>>    (seemingly oddly-placed code)
>>>
>>> Robin S.
>>> ---------------------
>>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>>>> Tim and Robin,
>>>>
>>>> Do you know what is the trouble with me.
>>>>
>>>> I can always better read code than even my own in any language written
>>>> comments.
>>>>
>>>> Beside me I have seen that most developers are not given with rich
>>>> possibilities to write comments (and to tell something you can disagree
>>>> with me; I have seen that those who are able to write very nice
>>>> comments often make very bad code).
>>>>
>>>> Just my thought,
>>>>
>>>> :-)
>>>>
>>>> Cor
>>>>
>>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>>>>I don't agree. I've written some really complicated programs
>>>>> with complex statistical calculations, and I always put
>>>>> in comments, if not for the poor guy who comes after me, then
>>>>> for me 6 months later when I'm no longer working on it, and I
>>>>> have to go back and fix it. It's been 2 years since I left
>>>>> that software behind, and I still get e-mails thanking me for
>>>>> documenting my code so well.
>>>>>
>>>>> Robin S.
>>>>> ----------------------------------
>>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>>>>> 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" <master_program***@outgun.com> wrote in message
>>>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
8 Dec 2006 5:46 PM
Cor Ligthert [MVP]
Tom,

How can we hope to have a reasonable conversation when people are arguing
before comments.

Comments should not be needed (with the exception as Robin told and I in
fact before him, that is to find where the underlying documentation for a
piece of code is or arguments why it is not done in another way when that is
more obvious).

You probably have never worked with well documentative program languages. I
did and I have seen people ruing those language making it a kind of
assembler and than fulfilling it with comments.

Robin has stated it in my idea very well although not in one thread.

I have seen a bunch of rotten code, very well commented because the
developer could not make a well written program.

I have seen often very well programs, unreadable because the programmer most
probably was driven by his manager to write comments. After deleting the
comments I could very well understand the program.

Therefore a well written program don't need comments which tell as Robin
already said.
'define a variable to hold the count
    Dim count as Integer

That is 90% (not even 80 as I normal write) the comments I have seen in my
live.

(spare me messages about my writting style I wrote it quick and very much
from my hart).

Cor



Show quoteHide quote
"Tom Leylan" <gee@iamtiredofspam.com> schreef in bericht
news:O9%23AFVuGHHA.1216@TK2MSFTNGP05.phx.gbl...
> Robin:
>
> How can we hope to have reasonable conversations when people are arguing
> against comments.  I don't know where they work but I've seen millions of
> lines of code and I'm sure each programmer thought the code was completely
> clear when in fact it was plainly not.  What seems obvious as it is being
> written won't be so obvious 3 years later when 8 of the original
> programmers have quit.  But let's say I include a SSort() routine, would
> developers recognize it as a "stable sort" just by reading the code?  I'll
> guess that 90% of the VB programmers haven't heard of a stable sort so how
> can they recognize one?  I'll also guess "what a dork doesn't he know
> there is a sort method" is what some of the folks here would say.
>
> But that is only one use of comments.  They have been elevated in status
> through the use of things like JavaDoc (in Java).  In large apps I've seen
> 3, 4 and 5 versions of "identical functionality" simply because none of
> the programmers knew the other functions existed when they wrote their own
> local version.  An automated system for producing printed documentation
> would go a long way to reducing this stuff.
>
> We also use them to track changes.  With business critical apps (and I
> mean daily or weekly turnaround schedules) it is important to know what
> changed, who changed it, when it was changed and why it was changed.
> There is no more sensible place to put this information than next to the
> code that actually changed.  And if you made a undocumented modification
> and the $14 million a year client dropped the company because your change
> ruined their system you can bet there would be repercussions.
>
> They aren't fun, and the system isn't perfect but how on Earth can anybody
> be arguing against commenting?  I suspect it's a game... the "your code is
> inferior because you have to comment it" gambit.  But my code isn't
> inferior it is as good or better and it has reasonable and useful comments
> as well.
>
> These types of threads come about continually, it's part of the coming of
> age of software developers.  I've had programmers (who "knew" they were
> the greatest) tell me that programmers don't read documentation.  When I
> challenged that statement he asked if I thought the majority of
> programmers read the docs and I answered, "no not the majority, just the
> good ones."
>
> Well that's my 2 cents... everybody carry on :-)
>
>
>
> "RobinS" <RobinS@NoSpam.yah.none> wrote in message
> news:Bo2dndYoUMupXerYnZ2dnUVZ_tqdnZ2d@comcast.com...
>> It *does* help if he has more than average knowledge, but I
>> don't like to assume that whoever comes along behind me *does*.
>> Plus, why should the poor guy have to spend extra time figuring
>> it out, when I can just put in a comment for him?
>>
>> Also, frequently it's a business-rule kind of thing, that's
>> not documented anywhere for the programmer. While I *love*
>> to get written business requirements from my clients, I rarely do.
>>
>> The specs for the last application I wrote were in the form
>> of a bunch of fields written on a piece of paper torn out of
>> a spiral notebook with the instructions "These are in three
>> different applications that we use, can you please figure out
>> how to get only *our* data out of those applications, for
>> only these fields, and put them in a central repository for us?"
>>
>> I like to leave external documentation behind with my finished
>> applications (in this case, I documented the database/table/fieldname,
>> and in most cases, the query used), but that's not always possible.
>>
>> To each their own, I just like to leave a helping hand to
>> whoever comes along behind me. It only takes me a few seconds.
>> (I type 100+ wpm).
>>
>> Robin S.
>> ---------------------------------
>>
>>
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:uGlJsecGHHA.2456@TK2MSFTNGP06.phx.gbl...
>>> Robin,
>>>
>>> Your particular comment suggest that the one who read it is able to
>>> understand what you are saying.
>>>
>>> In this case he needs some more than average knowledge of code to
>>> understand why something is done. That one does not need your comment,
>>> he/she sees it and thinks, whow I would not have done it that way,
>>> however according the quality of the rest of the program the developer
>>> should have had a special reason for that. Let me think twice and than
>>> probably sees the why.
>>>
>>> For a beginner this kind of comments has no sense even with the comment
>>> they don't understand it.
>>>
>>> However again just my personal opinion.
>>>
>>> In my opinion a good comment can be:
>>> 'See document xyz for an explanation of mathematics in the used code
>>>
>>> Cor
>>>
>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>> news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
>>>>I understand what you're saying. I'm not talking about comments
>>>> like this:
>>>>
>>>>    'define a variable to hold the count
>>>>    Dim count as Integer
>>>>
>>>> I'm talking about comments like this, that explain something out of
>>>> the ordinary, or explain *why* something is done a particular way:
>>>>
>>>>    'routine X seems like the logical place to put this instead
>>>>    '  of here in routine Y, but if you put it there instead of
>>>>    '  here, the dire consequences will be this
>>>>    '  (insert dire consequences). So even though this
>>>>    '  seems counterintuitive, don't move it. You'll regret it.
>>>>    (seemingly oddly-placed code)
>>>>
>>>> Robin S.
>>>> ---------------------
>>>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>>>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>>>>> Tim and Robin,
>>>>>
>>>>> Do you know what is the trouble with me.
>>>>>
>>>>> I can always better read code than even my own in any language written
>>>>> comments.
>>>>>
>>>>> Beside me I have seen that most developers are not given with rich
>>>>> possibilities to write comments (and to tell something you can
>>>>> disagree with me; I have seen that those who are able to write very
>>>>> nice comments often make very bad code).
>>>>>
>>>>> Just my thought,
>>>>>
>>>>> :-)
>>>>>
>>>>> Cor
>>>>>
>>>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>>>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>>>>>I don't agree. I've written some really complicated programs
>>>>>> with complex statistical calculations, and I always put
>>>>>> in comments, if not for the poor guy who comes after me, then
>>>>>> for me 6 months later when I'm no longer working on it, and I
>>>>>> have to go back and fix it. It's been 2 years since I left
>>>>>> that software behind, and I still get e-mails thanking me for
>>>>>> documenting my code so well.
>>>>>>
>>>>>> Robin S.
>>>>>> ----------------------------------
>>>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>>>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>>>>>> 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" <master_program***@outgun.com> wrote in message
>>>>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
9 Dec 2006 2:54 AM
RobinS
Well, it does depend on the code. As I said, and Cor agreed
with, adding comments that repeat the code is redundant. I
just add them to explain why I chose a particular method --
maybe because of something else that's happening somewhere
in the (huge) application, or because of a business reason.
Or if the code is really complicated, I'll put something in
to give the general idea.

I have known a lot of programmers that don't believe in it, but
my guess is they've never written anything so complicated it
requires a 30-page document just to explain the calculations
(been there, wrote the document), or they *have*, but they've
never had to change it or maintain it. *Or* they don't mind
spending days going through every line of code trying to figure
out exactly what it does. Ugh.

I even worked for one person who went through and *removed* my
comments. They said it made it harder for them to read the code.
About a year later, they called up and asked if I had a copy of
the code w/the comments in it (I did), and could I help them
figure something out because they had to change something in the
business logic, and they didn't have enough time to figure it
out by going through the code.

I guess the bottom line is that I tend to be detail-oriented,
and think about the long-term, and a few comments in the code
seems to make sense to me. I also have an appalling habit of
writing documentation for the really complicated stuff (like
the aforementioned calculations) to leave behind me. That's
just me.

Other people can make their own choices.

And that's *my* two cents'.

Robin S.
---------------------------------------------

Show quoteHide quote
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:O9%23AFVuGHHA.1216@TK2MSFTNGP05.phx.gbl...
> Robin:
>
> How can we hope to have reasonable conversations when people are arguing
> against comments.  I don't know where they work but I've seen millions of
> lines of code and I'm sure each programmer thought the code was completely
> clear when in fact it was plainly not.  What seems obvious as it is being
> written won't be so obvious 3 years later when 8 of the original
> programmers have quit.  But let's say I include a SSort() routine, would
> developers recognize it as a "stable sort" just by reading the code?  I'll
> guess that 90% of the VB programmers haven't heard of a stable sort so how
> can they recognize one?  I'll also guess "what a dork doesn't he know
> there is a sort method" is what some of the folks here would say.
>
> But that is only one use of comments.  They have been elevated in status
> through the use of things like JavaDoc (in Java).  In large apps I've seen
> 3, 4 and 5 versions of "identical functionality" simply because none of
> the programmers knew the other functions existed when they wrote their own
> local version.  An automated system for producing printed documentation
> would go a long way to reducing this stuff.
>
> We also use them to track changes.  With business critical apps (and I
> mean daily or weekly turnaround schedules) it is important to know what
> changed, who changed it, when it was changed and why it was changed.
> There is no more sensible place to put this information than next to the
> code that actually changed.  And if you made a undocumented modification
> and the $14 million a year client dropped the company because your change
> ruined their system you can bet there would be repercussions.
>
> They aren't fun, and the system isn't perfect but how on Earth can anybody
> be arguing against commenting?  I suspect it's a game... the "your code is
> inferior because you have to comment it" gambit.  But my code isn't
> inferior it is as good or better and it has reasonable and useful comments
> as well.
>
> These types of threads come about continually, it's part of the coming of
> age of software developers.  I've had programmers (who "knew" they were
> the greatest) tell me that programmers don't read documentation.  When I
> challenged that statement he asked if I thought the majority of
> programmers read the docs and I answered, "no not the majority, just the
> good ones."
>
> Well that's my 2 cents... everybody carry on :-)
>
>
>
> "RobinS" <RobinS@NoSpam.yah.none> wrote in message
> news:Bo2dndYoUMupXerYnZ2dnUVZ_tqdnZ2d@comcast.com...
>> It *does* help if he has more than average knowledge, but I
>> don't like to assume that whoever comes along behind me *does*.
>> Plus, why should the poor guy have to spend extra time figuring
>> it out, when I can just put in a comment for him?
>>
>> Also, frequently it's a business-rule kind of thing, that's
>> not documented anywhere for the programmer. While I *love*
>> to get written business requirements from my clients, I rarely do.
>>
>> The specs for the last application I wrote were in the form
>> of a bunch of fields written on a piece of paper torn out of
>> a spiral notebook with the instructions "These are in three
>> different applications that we use, can you please figure out
>> how to get only *our* data out of those applications, for
>> only these fields, and put them in a central repository for us?"
>>
>> I like to leave external documentation behind with my finished
>> applications (in this case, I documented the database/table/fieldname,
>> and in most cases, the query used), but that's not always possible.
>>
>> To each their own, I just like to leave a helping hand to
>> whoever comes along behind me. It only takes me a few seconds.
>> (I type 100+ wpm).
>>
>> Robin S.
>> ---------------------------------
>>
>>
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:uGlJsecGHHA.2456@TK2MSFTNGP06.phx.gbl...
>>> Robin,
>>>
>>> Your particular comment suggest that the one who read it is able to
>>> understand what you are saying.
>>>
>>> In this case he needs some more than average knowledge of code to
>>> understand why something is done. That one does not need your comment,
>>> he/she sees it and thinks, whow I would not have done it that way,
>>> however according the quality of the rest of the program the developer
>>> should have had a special reason for that. Let me think twice and than
>>> probably sees the why.
>>>
>>> For a beginner this kind of comments has no sense even with the comment
>>> they don't understand it.
>>>
>>> However again just my personal opinion.
>>>
>>> In my opinion a good comment can be:
>>> 'See document xyz for an explanation of mathematics in the used code
>>>
>>> Cor
>>>
>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>> news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
>>>>I understand what you're saying. I'm not talking about comments
>>>> like this:
>>>>
>>>>    'define a variable to hold the count
>>>>    Dim count as Integer
>>>>
>>>> I'm talking about comments like this, that explain something out of
>>>> the ordinary, or explain *why* something is done a particular way:
>>>>
>>>>    'routine X seems like the logical place to put this instead
>>>>    '  of here in routine Y, but if you put it there instead of
>>>>    '  here, the dire consequences will be this
>>>>    '  (insert dire consequences). So even though this
>>>>    '  seems counterintuitive, don't move it. You'll regret it.
>>>>    (seemingly oddly-placed code)
>>>>
>>>> Robin S.
>>>> ---------------------
>>>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>>>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
>>>>> Tim and Robin,
>>>>>
>>>>> Do you know what is the trouble with me.
>>>>>
>>>>> I can always better read code than even my own in any language written
>>>>> comments.
>>>>>
>>>>> Beside me I have seen that most developers are not given with rich
>>>>> possibilities to write comments (and to tell something you can
>>>>> disagree with me; I have seen that those who are able to write very
>>>>> nice comments often make very bad code).
>>>>>
>>>>> Just my thought,
>>>>>
>>>>> :-)
>>>>>
>>>>> Cor
>>>>>
>>>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
>>>>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>>>>>>I don't agree. I've written some really complicated programs
>>>>>> with complex statistical calculations, and I always put
>>>>>> in comments, if not for the poor guy who comes after me, then
>>>>>> for me 6 months later when I'm no longer working on it, and I
>>>>>> have to go back and fix it. It's been 2 years since I left
>>>>>> that software behind, and I still get e-mails thanking me for
>>>>>> documenting my code so well.
>>>>>>
>>>>>> Robin S.
>>>>>> ----------------------------------
>>>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>>>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
>>>>>>> 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" <master_program***@outgun.com> wrote in message
>>>>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
9 Dec 2006 12:57 PM
Master Programmer
' Say good by to the apostrophe

// because it's forward slash's for you all soon.

The Grand Master
VB 6.0 Jihad - Fight for your history and future


RobinS wrote:
Show quoteHide quote
> Well, it does depend on the code. As I said, and Cor agreed
> with, adding comments that repeat the code is redundant. I
> just add them to explain why I chose a particular method --
> maybe because of something else that's happening somewhere
> in the (huge) application, or because of a business reason.
> Or if the code is really complicated, I'll put something in
> to give the general idea.
>
> I have known a lot of programmers that don't believe in it, but
> my guess is they've never written anything so complicated it
> requires a 30-page document just to explain the calculations
> (been there, wrote the document), or they *have*, but they've
> never had to change it or maintain it. *Or* they don't mind
> spending days going through every line of code trying to figure
> out exactly what it does. Ugh.
>
> I even worked for one person who went through and *removed* my
> comments. They said it made it harder for them to read the code.
> About a year later, they called up and asked if I had a copy of
> the code w/the comments in it (I did), and could I help them
> figure something out because they had to change something in the
> business logic, and they didn't have enough time to figure it
> out by going through the code.
>
> I guess the bottom line is that I tend to be detail-oriented,
> and think about the long-term, and a few comments in the code
> seems to make sense to me. I also have an appalling habit of
> writing documentation for the really complicated stuff (like
> the aforementioned calculations) to leave behind me. That's
> just me.
>
> Other people can make their own choices.
>
> And that's *my* two cents'.
>
> Robin S.
> ---------------------------------------------
>
> "Tom Leylan" <gee@iamtiredofspam.com> wrote in message
> news:O9%23AFVuGHHA.1216@TK2MSFTNGP05.phx.gbl...
> > Robin:
> >
> > How can we hope to have reasonable conversations when people are arguing
> > against comments.  I don't know where they work but I've seen millions of
> > lines of code and I'm sure each programmer thought the code was completely
> > clear when in fact it was plainly not.  What seems obvious as it is being
> > written won't be so obvious 3 years later when 8 of the original
> > programmers have quit.  But let's say I include a SSort() routine, would
> > developers recognize it as a "stable sort" just by reading the code?  I'll
> > guess that 90% of the VB programmers haven't heard of a stable sort so how
> > can they recognize one?  I'll also guess "what a dork doesn't he know
> > there is a sort method" is what some of the folks here would say.
> >
> > But that is only one use of comments.  They have been elevated in status
> > through the use of things like JavaDoc (in Java).  In large apps I've seen
> > 3, 4 and 5 versions of "identical functionality" simply because none of
> > the programmers knew the other functions existed when they wrote their own
> > local version.  An automated system for producing printed documentation
> > would go a long way to reducing this stuff.
> >
> > We also use them to track changes.  With business critical apps (and I
> > mean daily or weekly turnaround schedules) it is important to know what
> > changed, who changed it, when it was changed and why it was changed.
> > There is no more sensible place to put this information than next to the
> > code that actually changed.  And if you made a undocumented modification
> > and the $14 million a year client dropped the company because your change
> > ruined their system you can bet there would be repercussions.
> >
> > They aren't fun, and the system isn't perfect but how on Earth can anybody
> > be arguing against commenting?  I suspect it's a game... the "your code is
> > inferior because you have to comment it" gambit.  But my code isn't
> > inferior it is as good or better and it has reasonable and useful comments
> > as well.
> >
> > These types of threads come about continually, it's part of the coming of
> > age of software developers.  I've had programmers (who "knew" they were
> > the greatest) tell me that programmers don't read documentation.  When I
> > challenged that statement he asked if I thought the majority of
> > programmers read the docs and I answered, "no not the majority, just the
> > good ones."
> >
> > Well that's my 2 cents... everybody carry on :-)
> >
> >
> >
> > "RobinS" <RobinS@NoSpam.yah.none> wrote in message
> > news:Bo2dndYoUMupXerYnZ2dnUVZ_tqdnZ2d@comcast.com...
> >> It *does* help if he has more than average knowledge, but I
> >> don't like to assume that whoever comes along behind me *does*.
> >> Plus, why should the poor guy have to spend extra time figuring
> >> it out, when I can just put in a comment for him?
> >>
> >> Also, frequently it's a business-rule kind of thing, that's
> >> not documented anywhere for the programmer. While I *love*
> >> to get written business requirements from my clients, I rarely do.
> >>
> >> The specs for the last application I wrote were in the form
> >> of a bunch of fields written on a piece of paper torn out of
> >> a spiral notebook with the instructions "These are in three
> >> different applications that we use, can you please figure out
> >> how to get only *our* data out of those applications, for
> >> only these fields, and put them in a central repository for us?"
> >>
> >> I like to leave external documentation behind with my finished
> >> applications (in this case, I documented the database/table/fieldname,
> >> and in most cases, the query used), but that's not always possible.
> >>
> >> To each their own, I just like to leave a helping hand to
> >> whoever comes along behind me. It only takes me a few seconds.
> >> (I type 100+ wpm).
> >>
> >> Robin S.
> >> ---------------------------------
> >>
> >>
> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> >> news:uGlJsecGHHA.2456@TK2MSFTNGP06.phx.gbl...
> >>> Robin,
> >>>
> >>> Your particular comment suggest that the one who read it is able to
> >>> understand what you are saying.
> >>>
> >>> In this case he needs some more than average knowledge of code to
> >>> understand why something is done. That one does not need your comment,
> >>> he/she sees it and thinks, whow I would not have done it that way,
> >>> however according the quality of the rest of the program the developer
> >>> should have had a special reason for that. Let me think twice and than
> >>> probably sees the why.
> >>>
> >>> For a beginner this kind of comments has no sense even with the comment
> >>> they don't understand it.
> >>>
> >>> However again just my personal opinion.
> >>>
> >>> In my opinion a good comment can be:
> >>> 'See document xyz for an explanation of mathematics in the used code
> >>>
> >>> Cor
> >>>
> >>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
> >>> news:tMqdnZ0zb7T3MerYnZ2dnUVZ_tudnZ2d@comcast.com...
> >>>>I understand what you're saying. I'm not talking about comments
> >>>> like this:
> >>>>
> >>>>    'define a variable to hold the count
> >>>>    Dim count as Integer
> >>>>
> >>>> I'm talking about comments like this, that explain something out of
> >>>> the ordinary, or explain *why* something is done a particular way:
> >>>>
> >>>>    'routine X seems like the logical place to put this instead
> >>>>    '  of here in routine Y, but if you put it there instead of
> >>>>    '  here, the dire consequences will be this
> >>>>    '  (insert dire consequences). So even though this
> >>>>    '  seems counterintuitive, don't move it. You'll regret it.
> >>>>    (seemingly oddly-placed code)
> >>>>
> >>>> Robin S.
> >>>> ---------------------
> >>>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> >>>> news:O5D4L0bGHHA.4688@TK2MSFTNGP04.phx.gbl...
> >>>>> Tim and Robin,
> >>>>>
> >>>>> Do you know what is the trouble with me.
> >>>>>
> >>>>> I can always better read code than even my own in any language written
> >>>>> comments.
> >>>>>
> >>>>> Beside me I have seen that most developers are not given with rich
> >>>>> possibilities to write comments (and to tell something you can
> >>>>> disagree with me; I have seen that those who are able to write very
> >>>>> nice comments often make very bad code).
> >>>>>
> >>>>> Just my thought,
> >>>>>
> >>>>> :-)
> >>>>>
> >>>>> Cor
> >>>>>
> >>>>> "RobinS" <RobinS@NoSpam.yah.none> schreef in bericht
> >>>>> news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
> >>>>>>I don't agree. I've written some really complicated programs
> >>>>>> with complex statistical calculations, and I always put
> >>>>>> in comments, if not for the poor guy who comes after me, then
> >>>>>> for me 6 months later when I'm no longer working on it, and I
> >>>>>> have to go back and fix it. It's been 2 years since I left
> >>>>>> that software behind, and I still get e-mails thanking me for
> >>>>>> documenting my code so well.
> >>>>>>
> >>>>>> Robin S.
> >>>>>> ----------------------------------
> >>>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
> >>>>>> news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
> >>>>>>> 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" <master_program***@outgun.com> wrote in message
> >>>>>>>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
Author
9 Dec 2006 5:04 PM
RobinS
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165669024.085672.128180@79g2000cws.googlegroups.com...
>' Say good by to the apostrophe
>
> // because it's forward slash's for you all soon.
>
> The Grand Master
> VB 6.0 Jihad - Fight for your history and future
>

//I can deal with that.
//I'm *flexible*.

Robin S.
Author
10 Dec 2006 12:46 AM
Master Programmer
Hey Aaaron

Check this out !  RobinS has finally admitted that VB is going to be
history.

Steve

RobinS wrote:
Show quoteHide quote
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165669024.085672.128180@79g2000cws.googlegroups.com...
> >' Say good by to the apostrophe
> >
> > // because it's forward slash's for you all soon.
> >
> > The Grand Master
> > VB 6.0 Jihad - Fight for your history and future
> >
>
> //I can deal with that.
> //I'm *flexible*.
>
> Robin S.
Author
10 Dec 2006 3:19 AM
Bruce W. Darby
No, she said she's flexible. :)

Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165711577.875709.82570@79g2000cws.googlegroups.com...
> Hey Aaaron
>
> Check this out !  RobinS has finally admitted that VB is going to be
> history.
>
> Steve
>
> RobinS wrote:
>> "Master Programmer" <master_program***@outgun.com> wrote in message
>> news:1165669024.085672.128180@79g2000cws.googlegroups.com...
>> >' Say good by to the apostrophe
>> >
>> > // because it's forward slash's for you all soon.
>> >
>> > The Grand Master
>> > VB 6.0 Jihad - Fight for your history and future
>> >
>>
>> //I can deal with that.
>> //I'm *flexible*.
>>
>> Robin S.
>
Author
10 Dec 2006 5:27 AM
RobinS
She? Never assume. :-)

You're right that I said I'm flexible. I have no control
over whether VB is going away, but if it does, I'll adapt.

Robin S.
--------------------------------------
Show quoteHide quote
"Bruce W. Darby" <kra***@comcast.net> wrote in message
news:HJOdnYx1PaJN4ebYnZ2dnUVZ_qisnZ2d@comcast.com...
> No, she said she's flexible. :)
>
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165711577.875709.82570@79g2000cws.googlegroups.com...
>> Hey Aaaron
>>
>> Check this out !  RobinS has finally admitted that VB is going to be
>> history.
>>
>> Steve
>>
>> RobinS wrote:
>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>> news:1165669024.085672.128180@79g2000cws.googlegroups.com...
>>> >' Say good by to the apostrophe
>>> >
>>> > // because it's forward slash's for you all soon.
>>> >
>>> > The Grand Master
>>> > VB 6.0 Jihad - Fight for your history and future
>>> >
>>>
>>> //I can deal with that.
>>> //I'm *flexible*.
>>>
>>> Robin S.
>>
>
>
Author
10 Dec 2006 6:04 AM
Bruce W. Darby
DOH!!! Uh... yeah.... hehehehe.... egg on me face.... :)

Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:fuidnQPVibgsB-bYnZ2dnUVZ_uiknZ2d@comcast.com...
> She? Never assume. :-)
>
> You're right that I said I'm flexible. I have no control
> over whether VB is going away, but if it does, I'll adapt.
>
> Robin S.
> --------------------------------------
> "Bruce W. Darby" <kra***@comcast.net> wrote in message
> news:HJOdnYx1PaJN4ebYnZ2dnUVZ_qisnZ2d@comcast.com...
>> No, she said she's flexible. :)
>>
>> "Master Programmer" <master_program***@outgun.com> wrote in message
>> news:1165711577.875709.82570@79g2000cws.googlegroups.com...
>>> Hey Aaaron
>>>
>>> Check this out !  RobinS has finally admitted that VB is going to be
>>> history.
>>>
>>> Steve
>>>
>>> RobinS wrote:
>>>> "Master Programmer" <master_program***@outgun.com> wrote in message
>>>> news:1165669024.085672.128180@79g2000cws.googlegroups.com...
>>>> >' Say good by to the apostrophe
>>>> >
>>>> > // because it's forward slash's for you all soon.
>>>> >
>>>> > The Grand Master
>>>> > VB 6.0 Jihad - Fight for your history and future
>>>> >
>>>>
>>>> //I can deal with that.
>>>> //I'm *flexible*.
>>>>
>>>> Robin S.
>>>
>>
>>
>
>
Author
10 Dec 2006 11:41 PM
Michael C
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:SYudnYThpPA_AOrYnZ2dnUVZ_q2pnZ2d@comcast.com...
>I don't agree. I've written some really complicated programs
> with complex statistical calculations, and I always put
> in comments, if not for the poor guy who comes after me, then
> for me 6 months later when I'm no longer working on it, and I
> have to go back and fix it. It's been 2 years since I left
> that software behind, and I still get e-mails thanking me for
> documenting my code so well.

The "grand master" is clearly trolling, ignore it.

Michael
Author
7 Dec 2006 5:23 AM
Bruce W. Darby
Sir,

While I apprciate your forthright comment that you write code that ANYONE
can follow without any trouble at all, experience has taught me that the
only one that could possibly understand uncommented code is the person that
wrote that code. And if the person that wrote that code doesn't have a
photographic memory, it is very clear that they will not remember the
millions of lines of code that they wrote during their career.

I'm fairly new to programing, though I have been in the computer industry
for several years. I actually got to work on some uncommented code that had
been written in a language that had been 'extrapolated' from the C
programming language. Took me almost three weeks to fix the issue because I
had to 'learn' the language and then try to figure out what had been
written. If the code had been commented, the job may have taken me a lot
less time than it did.

Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165455921.990418.179290@n67g2000cwd.googlegroups.com...
> 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" <master_program***@outgun.com> wrote in message
>> news:1165272758.241742.269670@j72g2000cwa.googlegroups.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
>
Author
7 Dec 2006 12:19 PM
C-Services Holland b.v.
Master Programmer wrote:
> 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
>
>

I disagree. Complex patterns need comments. In that explain what the
code does and why a certain method is chosen. A comment of 2 or 3 lines
can perfectly explain what code of multiple pages does. It certainly
helps maintaining the app especially if another person needs to go in
and add/change stuff in there. For instance I've used comments to
indicate why I chose a particular way of doing stuff because some quirk
in a programming language made it impossible to do it the obvious way.
That prevents someone going in in the future and changing it only to
find out the obvious way doesn't work.

For small routines consisting of just a few lines I agree it's not
always really nescesarry, but for big complex things not using comments
is just bad for future maintainence


--
Rinze van Huizen
C-Services Holland b.v
Author
7 Dec 2006 11:12 PM
Herfried K. Wagner [MVP]
"Master Programmer" <master_program***@outgun.com> schrieb:
> 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.

Basically I tend to agree.  Code should IMO be readable (which means that
the reader can reconstruct its meaning) without any comments, but comments
should support the reader by making understanding the meaning of the source
code easier.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
5 Dec 2006 9:41 AM
guy
people never look up to people who look down on them



Show quoteHide quote
"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
>
>
Author
7 Dec 2006 6:03 AM
Master Programmer
And rightly so, they must permission first

The Grand Master

guy wrote:
Show quoteHide quote
> people never look up to people who look down on them
Author
4 Dec 2006 2:50 AM
Michael C
Show quote Hide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)

Show quoteHide quote
>
Author
4 Dec 2006 4:45 AM
Cor Ligthert [MVP]
Strange: although I use both languages do I find especially the handling of
handlers very weak in C#.

Cor

Show quoteHide quote
"Michael C" <nospam@nospam.com> schreef in bericht
news:OCj3L40FHHA.3304@TK2MSFTNGP05.phx.gbl...
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)
>
>>
>
>
Author
4 Dec 2006 5:06 AM
Blake
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:
Show quoteHide quote
> Strange: although I use both languages do I find especially the handling of
> handlers very weak in C#.
>
> Cor
>
> "Michael C" <nospam@nospam.com> schreef in bericht
> news:OCj3L40FHHA.3304@TK2MSFTNGP05.phx.gbl...
> > "Master Programmer" <master_program***@outgun.com> wrote in message
> > news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)
> >
> >>
> >
> >
Author
4 Dec 2006 5:29 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Blake" <bl***@zgeek.com> schreef in bericht
news:1165208806.978700.211830@16g2000cwy.googlegroups.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" <nospam@nospam.com> schreef in bericht
>> news:OCj3L40FHHA.3304@TK2MSFTNGP05.phx.gbl...
>> > "Master Programmer" <master_program***@outgun.com> wrote in message
>> > news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)
>> >
>> >>
>> >
>> >
>
Author
4 Dec 2006 5:41 AM
Michael C
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OBnbTT2FHHA.1804@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
Author
4 Dec 2006 5:54 AM
Tim Patrick
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

Show quoteHide quote
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:OBnbTT2FHHA.1804@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
>
Author
4 Dec 2006 7:16 AM
Michael C
"Tim Patrick" <inva***@invalid.com.invalid> wrote in message
news:e3b4697631948c8e53caebf49c8@newsgroups.comcast.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
Author
4 Dec 2006 6:20 AM
Blake
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:
Show quoteHide quote
> 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.com> schreef in bericht
> news:1165208806.978700.211830@16g2000cwy.googlegroups.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" <nospam@nospam.com> schreef in bericht
> >> news:OCj3L40FHHA.3304@TK2MSFTNGP05.phx.gbl...
> >> > "Master Programmer" <master_program***@outgun.com> wrote in message
> >> > news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)
> >> >
> >> >>
> >> >
> >> >
> >
Author
4 Dec 2006 2:19 PM
Tom Leylan
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.


Show quoteHide quote
"Blake" <bl***@zgeek.com> wrote in message
news:1165213233.992190.243520@f1g2000cwa.googlegroups.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.com> schreef in bericht
>> news:1165208806.978700.211830@16g2000cwy.googlegroups.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" <nospam@nospam.com> schreef in bericht
>> >> news:OCj3L40FHHA.3304@TK2MSFTNGP05.phx.gbl...
>> >> > "Master Programmer" <master_program***@outgun.com> wrote in message
>> >> > news:1165199087.491438.325360@j44g2000cwa.googlegroups.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 :-)
>> >> >
>> >> >>
>> >> >
>> >> >
>> >
>
Author
4 Dec 2006 11:08 PM
Michael C
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:%23lO0A96FHHA.420@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
Author
5 Dec 2006 2:09 AM
RobinS
Show quote Hide quote
"Michael C" <nospam@nospam.com> wrote in message
news:OwIsrg$FHHA.1784@TK2MSFTNGP06.phx.gbl...
> "Tom Leylan" <gee@iamtiredofspam.com> wrote in message
> news:%23lO0A96FHHA.420@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.
Author
5 Dec 2006 2:26 AM
Michael C
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:S6OdnTgxFcZzSenYnZ2dnUVZ_oKdnZ2d@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
Author
5 Dec 2006 7:00 AM
RobinS
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.
----------------------------
Show quoteHide quote
"Michael C" <nospam@nospam.com> wrote in message
news:uaxglPBGHHA.5004@TK2MSFTNGP03.phx.gbl...
> "RobinS" <RobinS@NoSpam.yah.none> wrote in message
> news:S6OdnTgxFcZzSenYnZ2dnUVZ_oKdnZ2d@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
>
Author
5 Dec 2006 4:52 AM
Tom Leylan
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


Show quoteHide quote
"Michael C" <nospam@nospam.com> wrote in message
news:OwIsrg$FHHA.1784@TK2MSFTNGP06.phx.gbl...
> "Tom Leylan" <gee@iamtiredofspam.com> wrote in message
> news:%23lO0A96FHHA.420@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
>
Author
5 Dec 2006 5:39 AM
Michael C
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:e2M5hkCGHHA.3304@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
Author
5 Dec 2006 6:18 AM
Cor Ligthert [MVP]
Michael,

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

Cor

Show quoteHide quote
"Michael C" <nospam@nospam.com> schreef in bericht
news:OJJuJ7CGHHA.320@TK2MSFTNGP06.phx.gbl...
> "Tom Leylan" <gee@iamtiredofspam.com> wrote in message
> news:e2M5hkCGHHA.3304@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
>
Author
5 Dec 2006 6:43 AM
Michael C
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OGZDzTDGHHA.2632@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
Author
5 Dec 2006 6:36 AM
Tom Leylan
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

Show quoteHide quote
"Michael C" <nospam@nospam.com> wrote in message
news:OJJuJ7CGHHA.320@TK2MSFTNGP06.phx.gbl...
> "Tom Leylan" <gee@iamtiredofspam.com> wrote in message
> news:e2M5hkCGHHA.3304@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
>
Author
5 Dec 2006 7:04 AM
Michael C
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:usOykeDGHHA.320@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