|
|
 |
RE: FN-FORUM Digest V1 #4404
date posted 28th January 2003 19:13
Quoting Richard Parratt [EMAIL REMOVED]
> Um - I think the theory is that making functions class members obsoletes
> "with".
I don't think so - sooner or later you /have/ to deal with properties of
classes and at that point with becomes useful. Not only that, but where you're
working with something deep down a tree its also efficient.
A nice little article on optimisations a) notes that with is nice and efficient
because you've de-referrenced the object and don't need to do it again for each
property and b) that you can cheat in C# by having a local variable which you
set to whatever it is that you've got to work with down in the bowels of the
object tree and then use that instead. The interesting thing about this that
the resultant IL is near enough identical and efficient... which does kind of
suggest that with has its merits.
James Murphy
Consett, County Durham.
|
 |
|