in reply to Commented out production code?

I just wrote some code that looks like this:

my @logs = <LOGFILE>; chomp @logs; #XXX: map { &mung_log_entry($_) }, @logs;

Now, this isn't really the same kind of "commented-out code in production" that we've been arguing about; it's more of a pseudocode comment to tell me that I've been thinking about munging up each log entry after reading them all in. In this case, I think that writing the comment as "code" is more legible (mostly in that it doesn't break up the flow of code on the page) than writing in a little note in prose:

my @logs = <LOGFILE>; chomp @logs; # Mung up each log entry?

Eh. Matter of opinion, I guess. I think that the "code" comment more accurately conveys what I was thinking at the moment (even if it is an Evil Use of map In A Void Context -- hey, I said it was pseudocode).

Update:Yes, foreach would be clearer than map, but I've been thinking in terms of map lately.

--
:wq

Replies are listed 'Best First'.
Re (tilly) 2: Commented out production code?
by tilly (Archbishop) on Dec 13, 2001 at 23:19 UTC
    Wouldn't an inline foreach loop be clearer as a comment (particularly for whoever might come after) than the inline map?

    I know that I find it provides clearer documentation of intent. (Whether in a comment or in working code...)