There are known problems with debugging with instruction c. This is one of the reasons I delete them when I see them. In my opinion, you should never improve coding speed due to maintainability.
The general construct that I see a lot (and learned to hate) is:
with TMyObject.Create do try Method1(blah, blah, blah); Method2(blah, blah, blah); finally Free; end;
You can even add to a statement with several constructs:
with A, B, C, D do
But then again, sometimes there are valid uses for the with statement if you can replace:
ABCDEMethod1; ABCDEMethod2; ABCDEMethod3; ABCDEMethod4; ABCDEMethod5; ABCDEMethod6;
FROM
with ABCDE do begin Method1; Method2; Method3; Method4; Method5; Method6; end;
Although using ABCDE bit dubious, it tends to be a "delphi mode." But now, with class helpers, we can have the right solution:
TAHelper = class helper for TA public procedure Method1; endl procedure TAHelper.Method1; begin
So now you can use:
A.Method1;
Which is much better in my opinion.
Toon krijthe
source share