News for hackers. Stuff that matters.
Re:Thoughts on being a programmer by throwaway-864 on Wednesday August 15, 2012 @04:31AM (#4385123)
Check out Smart::Comments module in Perl [1].

It allows the specially-formatted comments to produce debugging output.

From the synopsis:

    use Smart::Comments;
     
    my $var = suspect_value();
     
    ### $var
     
    ### got: $var
     
    ### Now computing value...
     
    # and when looping:
     
    for my $big_num (@big_nums) {  ### Factoring...      done
        factor($big_num);
    }
     
    while ($error > $tolerance) {  ### Refining--->      done
        refine_approximation()
    }
     
    for (my $i=0; $i<$MAX_INT; $i++) {   ### Working===[%]     done
        do_something_expensive_with($i);
    }

[1] https://metacpan.org/module/Smart::Comments
Re:Thoughts on being a programmer by einhverfr on Wednesday August 15, 2012 @04:46AM (#4385154)
Noooooo..... Not magic comments.............

Magic comments are evil, the pox of the earth, etc. I have nothing good to say about comments as code. This totally messes up the separation between code and comment.