[Lazarus] Auto indentation

Aleksa Todorovic alexionne at gmail.com
Fri Nov 6 07:41:01 CET 2009


On Fri, Nov 6, 2009 at 07:18, Jürgen Hestermann
<juergen.hestermann at gmx.de> wrote:
>
> I *never* put deeper level commands/blocks on the same column

Yes, that's one of the worst things one can do.

> (including
> BEGIN/END) and I *always* align the BEGIN/ENDs.

Absolutely necessary, otherwise you get nice spaghetti :-)

> The BEGIN/ENDs delimit the
> block and are part of it so IMO they should be treated the same as all other
> commands of the block and be aligned with them.

On the other hand, I think of BEGIN/END as other commands are INSIDE
begin/end block, so I align begin/end with previous
if/while/for/procedure/function, and indent commands inside the block.

As of one-lines like:

if (a > b) then a := b;

I NEVER use them. They could take up less space, but it is very easy
to overlook them when you read lot of code. Moreover, having inner
command on the new line adds up to the consistency of your code.




More information about the Lazarus mailing list