[fpc-devel] C style operator doesn't work with properties in 2.3.1

Daniël Mantione daniel.mantione at freepascal.org
Thu Jul 17 09:43:15 CEST 2008



Op Thu, 17 Jul 2008, schreef Graeme Geldenhuys:

> On Thu, Jul 17, 2008 at 9:09 AM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>> Or
>>
>> with FDayList[itm.WeekDayNum].Rows[itm.Timeslot] do
>>  AvailableSlots:= AvailableSlots+itm.CountSlots;
>
>
> No that's one language construct I wish Object Pascal could do
> without!  I personally hate the 'with' statement, and it's hard to
> debug.

It is simply a tradeoff between readability and understandability. A line 
a:=a+1 is much more clean than a few lines of pointer dereferences, array 
indexes and records subscripts. The downside is that it becomes harder to 
track where the variables come from. Huge "with" bodies can be confusing. 
The programmer decides, after all writing readable code is an art.

Daniël


More information about the fpc-devel mailing list