Properties (should be simple!)

  • Thread starter Thread starter Guest
  • Start date Start date
No, I don't want to tell the compiler to stop emitting that warning
entirely though - I just want to *always* be able to describe
reasonable code in a way that doesn't cause the compiler to warn me in
the first place.

I noticed that I wrote Bullshit. Here are my corrected rules for recursive
calls:

- If the call to itself is the first method call in the method the compiler
should issue an error.

- If the call to itself is only preceeded by method/property invocations
than the compiler should only issue a warning.

- If the call to itself is in a condional statement (loop/if), or a return
or throw or precedes the recursive call, then no warning is issued.

It is similar to the warning "Unreachable code detected", but the other way
around: if the call to itself is reached in _every case_ then a warning
should be issued.
 
codymanix said:
I noticed that I wrote Bullshit. Here are my corrected rules for recursive
calls:

- If the call to itself is the first method call in the method the compiler
should issue an error.
Reasonable.

- If the call to itself is only preceeded by method/property invocations
than the compiler should only issue a warning.

That seems reasonable.
- If the call to itself is in a condional statement (loop/if), or a return
or throw or precedes the recursive call, then no warning is issued.
Yup.

It is similar to the warning "Unreachable code detected", but the other way
around: if the call to itself is reached in _every case_ then a warning
should be issued.

Right - the only exception being exceptions, if you'll pardon the pun.
I think that case is sufficiently nasty to allow spurious warnings...
 
Yeh, it is so simple that it closely resembles what the MS Research team
must be doing with their new shadow methods, synchronous and
asynchronous method calling syntax etc. :)

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
Back
Top