One of the things I've noticed quite often is someone will present their code like this:
if( $a > 5) {
echo $foo;
// why isn't it showing today?
}
?>
People then comment and sometimes downvote/closevote the question because...
- "what is
$a
?" - "where do you define
$foo
?" - "Unclear what you're asking"
- "
$foo
is not defined, echoing it outputs nothing" - and others.
Whenever I notice these, I hit the "Edit" button and if you do that to this post you'll see exactly what happened. The markdown input for the above is (Screenshot here):
One of the things I've noticed quite often is someone will present their code like this:
<?php
$foo = "bar";
$a = intval(date("m"));
if( $a > 5) {
echo $foo;
// why isn't it showing today?
}
?>
People then comment and sometimes downvote/closevote the question because...
The point is, is there a reason code blocks require an empty line before them, particularly since they don't require an empty line after? Couldn't it just detect the four-space-indent and go from there?
Secondary feature request: When hitting Enter, auto-indent to the same indentation as the previous line. It would save so much time! Maybe have it an option, though. I could live with Shift+Enter to do that.