Vannus wrote:


On 27 May 2010 20:25, waldo kitty <[email protected] <mailto:[email protected]>> 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... it is really
    bad when it spans 50 lines or more... especially when it covers
    several pages... at that point, you loose the rest of it...


im looking for indents, your looking for begin/ends. i think this is where 'what your used to' comes in.. we both use what suits us. when 'code' makes the 'if' big, then i put the 'code's into their own procedures/functions. keeps things neat & orderly. imho what the 'if' is doing is seperate from what the 'code' is doing.

(just a note)

In the early days of lazarus I learned not to trust indents.
When you have code committed by different ppl, using tab, 1sp 2sp or 3sp as indent, you cannot say for sure if an indent is part of the if statement or a misindeted following statement. Unless you read the whole if statement first.
This is why I personally really hate the above code.

Marc


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to