[Lazarus] Auto indentation
Jürgen Hestermann
juergen.hestermann at gmx.de
Thu Nov 5 17:46:25 CET 2009
> And that's kind of formatting that I don't like. My formatter would
> append dangling begins to the end of the preceding part of the
> statement. This is where the language syntax comes into play:
> Pascal:
> if a then BEGIN
> ...
> END else BEGIN
> ...
> END
And that's something *I* don't like. You never know which END belongs to
wheach BEGIN. I always column align all ENDs to their corresponding
BEGINs. That makes it much easier to check if some of these keywords are
missing:
if a then
begin
xxxxx
.....
yyyyy
zzzzz
end;
To me BEGIN and END clamp a logical block (that is indented by 3
characters) so they need to be aligned with all commands of the same
level. Each next block of IF, WHILE, REPEAT etc. is indented again by 3
characters. By following this strict rule the code is much more readable
to me.
More information about the Lazarus
mailing list