Re: Go ahead. Stop programming. This ensures you from any mistakes.
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sat, 9 Jun 2007 19:20:04 +0100
valentin tihomirov <V_tihomirov@xxxxxxx> wrote:
<snip>
The important case where
switches ARE INDISPENSABLE is jumping to a beginning of code. This is needed
when you mark a start/entry point to your code. For instance, you allocate
resourses 1, 2, 3 and roll back in case of error in reverse order 3, 2, 1 in
case of error starting at the reached stage. This is the fallthrough feature
which makes the switches indispensable.
I've never needed to do that, despite using multiple resources. The
"finally" part of a try/finally or a try/catch/finally statement is the
C# way of handling this.
And they are nothing like 'if' statements in this invaluable
scenario. Sadliy, when this technique is prohibited. It is especially
sad when good features are abandoned in favour of the people who do
not care about program statements execution flow.
Perhaps those people have a different (and IMO better and safer) idiom
in mind, such as "finally".
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Go ahead. Stop programming. This ensures you from any mistakes.
- From: valentin tihomirov
- Re: Go ahead. Stop programming. This ensures you from any mistakes.
- From: Ben Voigt [C++ MVP]
- Re: Go ahead. Stop programming. This ensures you from any mistakes.
- References:
- already used in a 'child' scope to denote something else
- From: valentin tihomirov
- Re: already used in a 'child' scope to denote something else
- From: Jon Skeet [C# MVP]
- Go ahead. Stop programming. This ensures you from any mistakes.
- From: valentin tihomirov
- Re: Go ahead. Stop programming. This ensures you from any mistakes.
- From: Göran Andersson
- Re: Go ahead. Stop programming. This ensures you from any mistakes.
- From: valentin tihomirov
- already used in a 'child' scope to denote something else
- Prev by Date: Re: Go ahead. Stop programming. This ensures you from any mistakes.
- Next by Date: Re: Go ahead. Stop programming. This ensures you from any mistakes.
- Previous by thread: Re: Go ahead. Stop programming. This ensures you from any mistakes.
- Next by thread: Re: Go ahead. Stop programming. This ensures you from any mistakes.
- Index(es):
Loading