I think you've hit upon a very basic dilemma that most, if not all, good programmers have. I know that issue is something I struggle with as well.
My solution to the problem has been two-fold:
- I make sure that the first thing on the line is the "important" code.
- I sometimes line-break then indent my logging code, to further emphasize its subordinate status.
Here's an example:
# bad
log("This code is broken!") unless $obj->method_call(arg1 => 'abc', ar
+g2 => 123);
# good
$obj->method_call(arg1 => 'abc', arg2 => 123)
or log("This code is broken!");
I'm not saying my way is the One True Way, but that's what I do and it works for me.
---
It's all fine and dandy until someone has to look at the code.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.