[Lazarus] clarification / Re: constant-highlight ? [Re: quick opinion poll / pascal highlighting "case"]

Vannus vannus at gmail.com
Thu May 27 22:27:18 CEST 2010


On 27 May 2010 20:25, waldo kitty <wkitty42 at windstream.net> 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.

taking the AI perpective:-
'if' - making decision.
'code' - acting on decision.

this lets you debug/maintain the decisions making from the acting on
decisions easily, and lets others pick up whats going on quickly..


>
>
>  involves less scrolling when its big, or when using smaller screen.
>>
>
> what's wrong with scrolling? here's another thought... what happens when
> you print out the code and then draw in vertical lines to delineate the
> individual blocks? i've had to do that many many times to locate where a
> semicolon or end statement was left out... it really sucked wasting
> sometimes hundreds of sheets of continuous feed paper so that it was all
> connected together... i wouldn't try it today with the single sheet feed
> stuff... this is one reason why i (still) keep several continuous feed
> printers around ;)


i find scrolling up & down constantly to make sure what i've done isn't
going to adversely affect the other code (proof-read the code) is an
unnecessary inconvenience.

i'll refer to my point below re semicolons :)
where end's should go is clear as well - at the beginning of every indented
line, unless starting a new if.


>
>
>  where the semicolons should go is clear
>> every line is functional, no redundant lines
>> more like one-line if
>>
>
> hehehe... more like a one line program :P ;)


i can only aspire to such things 8D


>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100527/a7153b06/attachment-0004.html>


More information about the Lazarus mailing list