Re: C# or VB.NET?

Tech-Archive recommends: Fix windows errors by optimizing your registry



What "new language syntax" are you refering to? With (statement) is just shorthand. I'm not aware of any caveats with it... or ambiguity between what appears in the block and what's scoped....
Please explain.

As for ambiguity between scoped variables... (Me, the equivalent of C#'s "this" removes all ambiguity).

--
-C. Moya
http://www.cmoya.com

"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> wrote in message news:eU7OII6UIHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
"CMoya" <moy@xxxxxxxxxx> wrote in message news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@xxxxxxxxxxxxxxxx

Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.

Now there I fundamentally disagree with you! I think the With keyword is positively horrible...

As you know, a 'with' statement would make C# more complex. As you will also know, VB.NET had to add new language syntax to address the potential ambiguity between a local variable (Text) and a property on the "with" target (.Text), and other ways of solving this problem also introduce language complexity.

A different approach is to push a scope and make the property hide the local variable, but then there's no way to refer to the local without adding some escape syntax.


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

.