@Thaddy DWIM leaves place for speculation,
As long as there is a scoping issue, yes, that's the whole point. It is speculative.,.
Even in some suggestions here like:
with b := Sender as TWhatever do
b.Caption := 'Click';
and TWhatever has a field named "b",.. is plain silly.
In general I see just suggestions that require *more* typing to circumvent *less* typing that "with" was introduced for.
As far as I am concerned that is bad language design. We have perfectly readable block-scoping already.
I am not against the use of "with" perse, I am against using it without thought. Usually programmers do not think...Only when the debugger (or a crash... more likely) forces them to do so..
And computer language design is simply based around that concept: programmers do not think, they try and see what happens...
That also means that language features that *require* thought by implication should be banned from a well designed language....
We are all a lot more stupid than we think...
Otherwise, why would only programmers need a
structured language? Now think about that: we are morons..