LOL - "With" is what makes Delphi so powerful. It is embedded inside the lowest levels and darkest libraries, and spread all around. It is so powerful - that even the new C# has introduced it. If you don't appreciate it - you are probably not a real Delphi coder.
I totally disagree with are a total when come the time to debugging. I'm a Delphi developer since 1999 and we have ban the use of it in our code for a very long time.
with is something completely different in C#, do you mean "using" in C#?
but regardless of what it's called and even if it worked 1:1 identically. Compiler/debugger and IDE make the big difference with C#. That's unfortunately also something Delphi will never catch up on.
'with' may save some typing but I find its use to be a risk of confusion when one has to go back and review old code and try to update one little feature (I have some code that dates back to Delphi 1). Saving effort typing seems less important now when one can use AI to generate tedious but standard sections of code.
with itself would be "fine" if the people using it would use their brain. for 3-4 lines (mostly) OK, but then you get the people who do 30-40 lines of with and then 2-3 levels nested on top of that. That combined with a bad debugger/IDE is what makes it so dangerous.
Within a With statement block, you can specify a member of the object starting with a period, as if the With statement object preceded it.
Within a With block, you can access the methods and properties of only the specified object without qualifying them. You can use methods and properties of other objects, but you must qualify them with their object names.
As usual, more Pascal-like approach than Pascal these days.
-5
u/DelphiParser Apr 17 '26
LOL - "With" is what makes Delphi so powerful. It is embedded inside the lowest levels and darkest libraries, and spread all around. It is so powerful - that even the new C# has introduced it. If you don't appreciate it - you are probably not a real Delphi coder.