Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Documenting Methods/Subs

by dragonchild (Archbishop)
on Jan 10, 2003 at 16:35 UTC ( [id://225855]=note: print w/replies, xml ) Need Help??


in reply to Documenting Methods/Subs

I've noticed that, personally, I only like subs to be commented (and heavily commented at that) if I don't know the code. Once I know the code, I actually hate the comments.

There's one file I'm working on right now that has every single function extensively documented with POD. I hate it, cause it gets in my way of seeing the whole code. But, when I first started working on it, it gave me a smidge of insight into what the author was thinking. (Granted, it's only a smidge cause the author sits about 50 feet from me, but it would've been a heck of a lot more if the author wasn't around to ask questions of.)

I guess that if the person after you can ask you questions, don't comment it. If the person after will not be able to ask you questions, comment evey single assumption you make. YMMV.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Documenting Methods/Subs
by seattlejohn (Deacon) on Jan 10, 2003 at 21:44 UTC
    I guess that if the person after you can ask you questions, don't comment it.

    I have to disagree. What if you leave the company? What if you get run over by a bus? What if you decide to go on vacation (heaven forbid!) and trek around the Himalaya for two weeks?

    Even if none of that happens, what happens when the code ships and gets forgotten, then someone decides to dust it off three years later? It's ancient history; will you really remember what you were thinking when you wrote it?

    I suppose it's possible to go overboard with documentation, but I guess I find it much easier to ignore something that is there than to fill in something that isn't. I rarely trust myself to be able to remember my own thought process a couple of years down the road, let alone reconstruct somebody else's.

            $perlmonks{seattlejohn} = 'John Clyman';

      What if you get run over by a bus?

      Maybe my tongue was a little too far in my cheek. *winces* I firmly hold that the "Bus Number" of any group should never be 1. (And, if anyone can come up with a link that doesn't involve TWiki re: Bus numbers, that would be great!)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://225855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-23 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found