On 27 May 2010 20:25, waldo kitty <[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. 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 > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus >
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
