Re: For vs. For Each
From: Your_name (dfd_at_dkjdsf.com)
Date: 08/11/04
- Next message: siny777: "CAB Packaging Question"
- Previous message: Bud Cookson: "Medical Devices"
- In reply to: Gabriele G. Ponti: "Re: For vs. For Each"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: For vs. For Each"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Aug 2004 15:13:49 GMT
"Gabriele G. Ponti" <ggponti.at.hotmail.com> wrote in
news:#CcNh$6fEHA.2812@tk2msftngp13.phx.gbl:
> Anders Hejlsberg: "Generally my answer is, Always use FOR EACH if you
> can, because chances are you will have fewer bugs if you use FOR EACH.
> There are just more pitfalls with the regular FOR statement. It is
> true that in some cases the FOR statement is more efficient. I think
> the vast majority of cases, I don’t think you would ever notice. My
> advice would be, always use FOR EACH profile your app. If they turn
> out to be your problem, then change them to FOR statements, but I
> don’t think you ever will in real code. I think FOR EACH is much more
> expressive, and in theory allows us to optimize your code more in the
> future. There are certain optimizations that we will do, because we
> can tell that you’re going over the entire collection or whatever, and
> so we could, at least in theory, generate even better code. I would
> highly recommend FOR EACH unless you really do need the index."
>
> http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20040624c
> sharpah/manifest.xml
>
>
The big man has spoken, end of discussion :D
- Next message: siny777: "CAB Packaging Question"
- Previous message: Bud Cookson: "Medical Devices"
- In reply to: Gabriele G. Ponti: "Re: For vs. For Each"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: For vs. For Each"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|