Results 1 to 40 of 95

Thread: Note to community

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2011
    Posts
    65

    Re: Note to community

    This is overly wordy commenting but thats just my thoughts. Here is how I comment:

    Code:
     Private Sub frmGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Reset
            ResetDisplay()
    
            'Initialize List
            Numbers = New List(Of Integer)
    
            'Start Timer
            BingoTimer.Start()
    
            'Generate Card
            For index = 0 To 41
                CardNumbers(index) = Rand.Next(1, 100)
            Next
    
            'Images
            imgGridBall(0) = "Images\Ball_1.png"
            imgGridBall(1) = "Images\Ball_2.png"
            imgGridBall(2) = "Images\Ball_3.png"
    
            'Build Grid
            BuildGrid()
        End Sub

  2. #2
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: Note to community

    Quote Originally Posted by mholmes_3038 View Post
    This is overly wordy commenting but thats just my thoughts. Here is how I comment:
    As a few others have said, those comments are largely restating the code without adding anything. There is one comment that adds some value, the "Generate card" comment on the loop. And you don't need to have a comment to say that. How about this:

    Code:
     Private Sub frmGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ResetDisplay()
            Numbers = New List(Of Integer)
            BingoTimer.Start()
            GenerateCard()
            SetImages()
            BuildGrid()
        End Sub
    
        Private Sub GenerateCard
            For index = 0 To 41
                CardNumbers(index) = Rand.Next(1, 100)
            Next
        End Sub
    
        Private Sub SetImages()
            imgGridBall(0) = "Images\Ball_1.png"
            imgGridBall(1) = "Images\Ball_2.png"
            imgGridBall(2) = "Images\Ball_3.png"
        End Sub

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width