Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Fenrir has been taken by a fey mood!  (Read 4315 times)

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: Fenrir has been taken by a fey mood!
« Reply #15 on: November 08, 2008, 03:09:12 pm »

Commenting is hard for me. I don't know what or where to comment, because everything seems obvious when I'm programming it (I'm a Dabbling Programmer, so it rarly is obvious later).
« Last Edit: November 08, 2008, 03:15:39 pm by Fenrir »
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Fenrir has been taken by a fey mood!
« Reply #16 on: November 08, 2008, 03:52:00 pm »

Commenting is hard for me. I don't know what or where to comment, because everything seems obvious when I'm programming it (I'm a Dabbling Programmer, so it rarly is obvious later).

Rule of thumb: if you had to think about a line of code while writing it, comment it.
Safer rule: EVERYTHING.
Logged

Gantolandon

  • Bay Watcher
  • He has a fertile imagination.
    • View Profile
Re: Fenrir has been taken by a fey mood!
« Reply #17 on: November 08, 2008, 04:04:15 pm »

Quote
Commenting is hard for me. I don't know what or where to comment, because everything seems obvious when I'm programming it (I'm a Dabbling Programmer, so it rarly is obvious later).

Comment functional blocks, not singular lines. Everybody knows that "i++" means "increment the counter". But no one would know for sure what the thirteen lines long code inside a loop does, and without a comment it would be needed to guess the programmer's intentions. And it's not always obvious what did he want to achieve.
Logged

Gigalith

  • Bay Watcher
    • View Profile
    • O and H Books
Re: Fenrir has been taken by a fey mood!
« Reply #18 on: November 10, 2008, 07:15:10 am »

My commenting is rule is: If I can't tell what it does at a glance or two, comment it.
Logged
Check out my books at O and H Books
Pages: 1 [2]