Is there a way in C # to access the properties of an object in old, Pascal with a "keyword"?
3 answers
You can find an explanation here.
Excerpts:
- Little or nonexistent benefits of reading. We thought the benefits of reading were small or nonexistent. I won't go so far as to say that the with statement makes the code less readable, but some people probably will.
- Increased language complexity. Adding a with statement will make the language more complex. For example, VB had to add a new syntax to the language to eliminate potential ambiguity between the local variable (Text) and the "with" property of the target (.Text). Other ways to deal with this problem also involve language complexity. Another approach is to push the scope and force the property to hide the local variable, but then there is no way to refer to the local without adding escape syntax.
- legacy of C ++. C ++ has never had a c operator, and the absence of such a statement is not usually considered by C ++ developers. Also, we didn't feel that the other changes were changes in the types of people who write, platform changes, other language changes, etc. - made with more necessary statements.
+6
source to share