[Lazarus] Auto indentation

Jürgen Hestermann juergen.hestermann at gmx.de
Fri Nov 6 17:21:30 CET 2009


> 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.

Yes, lots of people think so. But beside the logic (to me the BEGIN/ENDs 
are part of the block) it is confusing if for some IF/WHILE/REPEAT 
statements the next line is aligned and for others (without BEGIN/END, 
just one command) it is not. Also, the IF/WHILE/REPEAT statements stand 
out much better if the next line is always indented.

> 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. 

Yes, that's true. I only use this in situations where the command is of 
low importance (i.e., if it does a side thing that is not very related 
to the major task) and when otherwise the code would be teared too much 
apart.





More information about the Lazarus mailing list