4 ms·
Interesting to see that they don't shy away from using goto in their code. http://roslyn.codeplex.com/SourceControl/latest#Src/Compilers/CSharp/Source/Parser/L
by weavie 13y ago
Interesting to see that they don't shy away from using goto in their code.
http://roslyn.codeplex.com/SourceControl/latest#Src/Compilers/CSharp/Source/Parser/Lexer.cs http://roslyn.codeplex.com/SourceControl/latest#Src/Compiler...
Something I've just learned from looking at the code is you can jump between cases in a switch statement :
switch (a) {
case '1':
...
case '2':
goto case '1';
}
Never realised you could do that.
- sz4kerto 13y agoYou can even jump back from a catch or finally handler to the try block ;) At least in MSIL.
- ygra 13y agoSometimes you even have to, because fall-through is illegal in C# except with empty case labels. goto case makes things more explicit. Although there is no reason why they wouldn't use goto. The oft-cited "goto statement considered harmful" was in a very different context and basically just ranted against using goto when there are control structures that make intent clearer.