I've been coding this way for nearly 20 years now.
Lining up braces for fast visual checking has made my life easier many
times.
However, I won't push for any change in this respect, since the matter
is like the tug-of-war between vi and emacs.
However, I am an ardent support of long lines. Requiring lines to be
hard-wrapped at some position is for those using green screens and
editors from the 1970's. ... cricket .. cricket .. I hope nobody takes
this as trolling .. I'm just trying to keep a friendly, humorous
atmosphere :)
Cheers,
Gavin
Mat Scales wrote:
Pádraic Brady wrote:
-->
Still effects readability though :). Are we worried about screen space?
If I'm honest, I don't like much of the coding standards for the
framework, but I do understand that we need to have something in place
and that it's the sort of thing developers get religious about. Given
that standards are now in place and that preferences aside it doesn't
make much difference, I don't see the value in discussing it. There
will never be absolute consensus on coding standards for any group of
programmers larger than 1 :)
However :)
For reference, my preferred coding standards give you code like:
<?php
class Foo
{
public $bar;
private $quux;
public function Test( $text )
{
if( $text != "" )
{
print( $text );
}
else
{
throw new Exception( "Test called with no text!" );
}
}
private function SomeDatabaseStuff( $id )
{
$db = new DatabaseConnection( "somedsn" );
$result = $db->Query( "
SELECT
foo,
bar,
baz
FROM
some_table
WHERE
id = ?
LIMIT 1
",
array( $id )
);
return $result[ 0 ];
}
}
?>
We use tabs to indent and we have no maximum line length because all
of our editors have the same tab size and do good soft-wrapping.