[fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

Bo Berglund bo.berglund at gmail.com
Wed Feb 24 12:30:18 CET 2016


On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth
<pascaldragon at googlemail.com> wrote:
>
>What would really help here would be the warning that Jonas mentioned...
>For the above you could just use a local variable and be done with it. No
>need to try to "fix" the with-statement.

I really fully agree!
When working a few years back I had to trace through a piece of code
where the original author had done something like:

with My.Stuff.something do
  with My.Other.Stuff.somethingelse do
    with myyetanother do
    begin
      someproperty := xxx;
      ....
      ....
    end;
It was totally impossible to make sense of anything while debugging!

WITH should be abolished in my view!

I had to make local variables to shorten down the length of the
identifiers and then put the correct variable in front like:
  MS.someproperty := xxx;

Only then was it possible to inspect the values while debugging.

Further: I see every other day in the Embarcadero forum comments by
Remy Lebeau where he strongly advices against using WITH. Only goes to
show that it plagues Delphi as well.

Join the crusade against WITH!!!


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list