What's the rationale of the "Of" in the Generic Namespace documentation?

C

csharper

I have been puzzled by this "Of" preposition for some time.

For example, at http://msdn.microsoft.com/en-us/library/0sbxh9x2.aspx , you will see a lot of Of T, Of TKey, TValue in the list of classes in the right frame. For example, Comparer(Of T), Dictionary(Of TKey, TValue).

Interestingly, in the left frame, the "Of" preposition is omitted, so we only see Comparer(T), Dictionary(TKey, TValue).

Why introducing this "Of" to confuse us? What's the rationale of this puzzling "Of"?
 
C

csharper

I see (for example) "Comparer<T>".

The difference is what language the code snippets are set to. The "Of
T" syntax is from VB.NET, and you'll see that if you have the code
snippets set to "VB" on the web site. But if you set the code snippet
to "C#" then you should see C# syntax in the main frame (the nav frame
stays the same).

Pete

I see. My browser displays the MSDN documenation website in lightweight mode. I played around trying to figure out how to change the language (programming language) setting and saw a small preferences icon on the top right corner. I clicked it and set the display mode to classic and then I was able to select the languages. Thanks. I never seriously coded in VB, so I wasn't aware that this "Of" seems to be a keyword in VB.
 
A

Arne Vajhøj

I have been puzzled by this "Of" preposition for some time.

For example, at http://msdn.microsoft.com/en-us/library/0sbxh9x2.aspx , you will see a lot of Of T, Of TKey, TValue in the list of classes in the right frame. For example, Comparer(Of T), Dictionary(Of TKey, TValue).

Interestingly, in the left frame, the "Of" preposition is omitted, so we only see Comparer(T), Dictionary(TKey, TValue).

Why introducing this "Of" to confuse us? What's the rationale of this puzzling "Of"?

C# is from the C++/Java family of languages where the tradition
is to use special non-letter characters for many things.

VB.NET is from the Basic family of languages where the tradition
is to us English keywords for many things.

So C# picked List<string> while VB.NET picked List(Of String).

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top