Re: Commenting source code is for amateurs
From: clintonG (csgallagher_at_REMOVETHISTEXTmetromilwaukee.com)
Date: 09/23/04
- Next message: Engineerik: "Updating datasets Question"
- Previous message: Drebin: "Re: SQL Connection Program Name"
- In reply to: Brian Henry: "Re: Commenting source code is for amateurs"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Commenting source code is for amateurs"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 13:37:58 -0500
Professionals also use short paragraphs and white space when writing ;-)
--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET csgallagher@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Brian Henry" <brianiupmsdn@newsgroups.nospam> wrote in message
news:uNjvjyQoEHA.3324@TK2MSFTNGP10.phx.gbl...
> Comments and massive documentation are done in professional software
> development... if you don't explain what a function does in comments and
> documentation how will you remember what it does after writing another 400
> functions? most likely you will forget what 80% of them do by that point
and
> will need some kind of reference.. and when someone else starts working on
> your code also in a team they definatly need reference points to look at
> such as comments, markers, and documentation to even begin to understand
> what is going on in code especially on a massive scale like 100,000+ lines
> of code... so saying comments are useless, pointless, or anything else
> similar to that is just stupid. people may think they are "1337" just
> because they can read code without comments, but if you had a 100 line
> function and had no clue what it did uncommented would you want to step
> through it line by line to determine exactly what it does, what it effects
> and what it may return? I doubt you would want to waste that time.
>
>
> "Marian F." <NoSpam@NoSpam.Net> wrote in message
> news:ufOf2APoEHA.3988@tk2msftngp13.phx.gbl...
> > The 12 years old genius function to count english words in a sentence:
> >
> > ' This is my function to count english words in your string
> > ' s is the string with your words to be counted
> > ' Returns an integer as the number of words found
> > Public Function iCW(ByVal s As String) As Integer
> > ' We start declaring the variable to count words
> > Dim c As Integer
> > ' This is the variable used in the for next loop
> > ' to check every char in your string s
> > Dim i As Integer
> > ' Now check all chars in your string s
> > ' Starts with the 1st char, i = 1
> > ' up to last char, s.Length
> > For i = 1 To s.Length
> > ' check is the char is a space
> > If Mid(s, i, 1) = " " Then
> > ' if it is a space, increment the word count WordCount
> > c += 1
> > ' if it is not, then do nothing
> > End If
> > ' continue to check words until no more
> > Next
> > ' return the word count, c
> > ' after adding 1 to compensate for the word before the first space
> > Return c + 1
> > End Function
> >
> >
> > The semi-pro solution to count english words in a sentence:
> >
> > Public Function WordCount(ByVal Text As String) As Long
> > While InStr(Text, " ") ' remove double spaces
> > Replace(Text, " ", " ")
> > End While
> > If Replace(Text, " ", "") = "" Then Return 0 ' only spaces
> > Dim WordCount As Long
> > For i = 1 To Len(Text)
> > If Mid(s, i, 1) = " " Then WordCount += 1
> > Next
> > Return WordCount + 1
> > End Function
> >
> > The pro solution is the same as the semi-pro but without comments
> >
> > MF
> >
>
>
- Next message: Engineerik: "Updating datasets Question"
- Previous message: Drebin: "Re: SQL Connection Program Name"
- In reply to: Brian Henry: "Re: Commenting source code is for amateurs"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Commenting source code is for amateurs"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|