already used in a 'child' scope to denote something else
- From: "valentin tihomirov" <V_tihomirov@xxxxxxx>
- Date: Fri, 8 Jun 2007 09:59:46 +0300
{
int i = 2;
}
int i = 1;
There is no 'i' defined in the 'parent' context from the moment of
declaration on. So what is the problem? They tell us they pursue language
simplicity. The rule "do not define a variable more than once in the same
context" is natural, and simplest therefore. All normal languages obey it
therefore. Overcomplicating a grammar by injecting more barrieres is a path
right away from simplicity. Another obstacle at the plain place introduced
in C# for no reason is blocking "fall throughs" in switch -- the feature
wich can be very useful sometimes. C# designers demonstrate some excessive
zeal on 'protecting' us from doing things naturally, going strightforward
ways.
"Give a fool rope enough and he'll hang himself."
.
- Follow-Ups:
- Re: already used in a 'child' scope to denote something else
- From: Jon Skeet [C# MVP]
- Re: already used in a 'child' scope to denote something else
- Prev by Date: free .net controls http://www.controlstrading.com/
- Next by Date: VistaDB Database
- Previous by thread: free .net controls http://www.controlstrading.com/
- Next by thread: Re: already used in a 'child' scope to denote something else
- Index(es):
Relevant Pages
|