|Subject:||Re: Access instance created in with .. do|
|Posted by:||Mark Patterson (noe_zp…@stopbots.org)|
|Date:||Thu, 22 Jun 2006|
Joanna Carter [TeamB] wrote:
> First of all "with" is evil ! :-))
Seconded! When I started out in 1995 with Delphi after C, I thought with
was great. I had compound with statements, and used them all over the
place. Then going back to the code later I found them a pain to read,
and they sometimes caused bugs. A method that was supposed to apply to
the Self would catch me by surprise at times, and prove hard to debug.
Plus it slows down the reading. You have to assess which object a thing
applies to. In my current project, which I am maintaining, I have
systematically removed with statements.
The idea that they're all right if used judiciously is not that strong.
Why complicate a language with a feature that is not really needed,
gives rise to bugs and makes code harder to read?
When you program, it should be with the maintenance programmer in mind,
not just getting the next feature working as soon as possible. It may
take 10 minutes for one programmer to think up an algorithm for new
code, but it can take hours for the next developer to understand it.
Give the next guy all the help you can.
Re: Access instance created in with .. do posted by Joanna Carter [TeamB] on Wed, 21 Jun 2006