Subject Re: [IBO] Syntax
Author Svein Erling Tysvær
>I often wonder about this sort of thing. Do personal preferences about
>syntax choice make any difference to the compiled code? Are there penalties
>for making one's source code as comprehensible as possible?

There may be penalties. I don't know about the Assign method, but using
FieldByName in a loop makes IBO search for the field in every iteration
which is considerably slower than using Fields[<fieldno>]. For better
readability, one may use variables of type TIB_Column (or TIB_Field - I
never use these and don't quite know) and assign the actual field to the
column before starting the loop. If I've understood former suggestions on
this list, this should be of similar speed to Fields[<fieldno>].

In general, I think code should be as easily readable as possible - it
makes a difference when changing the programs. But the difference in
readability between

Fields[0].AsString:='Svein Erling Tysvær'; //Name

and

FieldByName('Name').AsString:='Peter Lawson';

is - according to my view - not as big as the performance penalty if part
of a long-lasting loop.

I've also found BeginBusy and EndBusy worth using when speed is an issue
with loops in interactive applications, as well as carefully examining
plans of course.

Set