Re: Funny loop with post-increment.

Ryan Heath <[email protected]> Tue, 19 Feb 2008 10:25:30 +0100
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
On Feb 19, 2008 9:44 AM, Frans Bouma <[email protected]> wrote:
> > Don't forget that this is a POST-increment. The return value of i++ is the
> > original value of i, before it was incremented.
>        Then it makes sense. (but the compiler should throw a warning, as it's
> non-obvious code. For the 99% of the C# users who don't know the spec in every
> detail)

That's my whole point. The behaviour is documented but its not
obvious. So why is C# supporting this behavior?

You *could* compare it to macroes, C# does not support macroes, and I
am glad it does not.
Too often macroes led to code that was not so obvious at all...

// Ryan

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com