Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: I wrote some clever code - can the comment "defuse" it?

by hardburn (Abbot)
on Jun 17, 2003 at 21:51 UTC ( #266654=note: print w/ replies, xml ) Need Help??


in reply to I wrote some clever code - can the comment "defuse" it?

I'd treat this bit of code as a black box. In other words, the comment should say what input is expected and what will come out again. The "how" part is left as an exercise to your future self :)

Reasoning : you can't be sure that your comment will make things any more understandable at some point in the future, but with "black box code", you can at least be sure your future self will know how to rewrite that bit, should you feel the need to.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated


Comment on Re: I wrote some clever code - can the comment "defuse" it?
Replies are listed 'Oldest First'.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2015-07-07 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (91 votes), past polls