On 05/27/2010 09:25 PM, waldo kitty wrote: > On 5/26/2010 14:26, Vannus wrote: >> IMO thats redundant lines + more scrolling to read the code. whereas:- >> >> if x then begin >> code >> end else begin >> if y then begin >> code >> end else begin >> code >> end; >> end; >> > > the above format hurts my eyes... i cannot see else, for one thing, > and cannot separate out the individual code blocks...
That is why I love half-indentation: . + two spaces after a "begin", unless the line begins with an "end" . - two spaces before a line that is just "end;" . - one space for the line "end else begin" . + one space after that line This clearly shows the "if" (or "while" or whatever) block structure, as the "if" (or whatever keyword) that starts the line that ends with a "begin" is at the same column as the final corresponding "end". Moreover the "else" can easily be found as it is "half unindented" regarding the "if" block. The downside is that more indentation space is necessary versus indenting just a single space. But for readability, too deep structures should be avoided (by calling a procedure) anyway. -Michael -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
