No, I don't mean "always the same way." I'm talking about avoiding inconsistent indentation style like:
if (condition)
{
code;
other_code;
}
else {
bork; }
if (condition_2) {
foo;
}
else
{
i_think_you_get_what_i_mean();
}
I don't peronsally mind if a block is on one line, as long as it's short.
if (condition) { $foo=0; $bar++; } is perfectly fine. I mean consistency within a file, given the context. If you always put short blocks on one line, great. If you do something like
if (condition) { $foo=0; $bar++ }
# more code...
if (other_condition) {
$foo++;
}
then I consider it to be inconsistent. And when I find inconsistent indentation it implies to me that your thinking isn't clear. This may or may not be the case -- it's more of an impression I get than an absolute rule.
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.