I had an interesting idea I wanted to put out there. If I'm being a
good boy and commenting my code, I do things like the following pseudocode:
# Get the stuff and do other stuff with it
@lines = slurp("file");
@otherlines = map { s/foo/bar/ } @lines
putfile("file", @lines);
$t = 3;
....
Anyway, my point is, how much of the code does the comment apply to.
I was thinking it might be a good idea to have a comment that indicates when
the code that the previous comment applies to ends. So you could have
something like this:
#{ Get the stuff and do other stuff with it
@lines = slurp("file");
@otherlines = map { s/foo/bar/ } @lines
putfile("file", @lines);
#}
$t = 3;
....
...and then both people and parsers would be able to determine which
part of the code your comment applies to, and we'd be able to automatically
determine the comment coverage of our code, as well as the test coverage. I'm
perfectly well aware that the syntax I suggested about conflicts with the
existing Perl 6 spec, and I'd love it if people suggested a better
alternative.
Just to make myself clear, in the above example, I'm not commenting
out any of the code, merely indicating which code the comment applies to.
Anyway, just some thoughts...
:).
---------------------------------------------------------------------
| Name: Tim Nelson | Because the Creator is, |
| E-mail: wayl...@wayland.id.au | I am |
---------------------------------------------------------------------
----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----