3

What is the official marketing name for C# 4?

  • Apress writes "Visual C# 2010 Recipes"
  • Apress also writes "Pro C# 2010 and the .NET 4 platform"
  • O'Reilly also writes "Microsoft Visual C# 2010"
  • Jon Skeet and Scott Hanselman both write C# 4
  • yet Dino Esposito writes C# 4.0
  • this MSDN page is entitled Visual C# 2010 Samples, refers to C# 4.0, and people writing in the comments refer to both C# 4 and C# 4.0

If we are going to publish training material about C# 4, what term should we use?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
  • 1
    Your title says "official marketing name". I come to think there are 1 official name and many marketing names. – H H Jul 05 '10 at 09:23

10 Answers10

14
  • Microsoft Visual C# 2010 is the C# specific part of the integrated development environment Microsoft Visual Studio 2010.

  • C# 4.0 is the language.

  • Microsoft .NET Framework 4.0 is the framework.

It is common to shorten 4.0 to 4.


This is a response to Adrian Grigores comment "The .NET version does determine the syntax and semantics of the C# language".

There are (at least) three partially independent version numbers - the .NET Framework version, the Common Language Runtime (CLR) version, and the C# version (see this StackOverflow question for a quite comprehensive list of Framework and CLR versions).

The C# version determines what language features are available. Language features are based on .NET Framework features - the included framework assemblies and CLR version. Finally every .NET Framework versions includes a specific CLR version that basically determines what is valid Common Intermediate Language (CIL) code and how it must be interpreted. Some examples.

C# 3.0 introduces automatic properties. This feature is build into the compiler and does not rely on new functionalities in the .NET Framework assemblies or even the Common Language Runtime (the .NET Framework 3.0 still contains the CLR 2.0). Therefore it is possible to build an application using automatic properties and targeting the .NET Framework 2.0 (maybe even 1.0 and 1.1).

C# 3.0 introduces LINQ. This feature is mainly build into the compiler but partly relies on assemblies new in the .NET Framework 3.0. LINQ to Objects for example relies on the new System.Core.dll containing the Enumerable class. It is however possible to fake this dependencies and therefore use LINQ to Objects with the .NET Framework 2.0.

C# 2.0 introduces generics. This feature relies on extension of the CIL in the CLR 2.0. Therefore it is not possible to use generics with the .NET Framework 1.0 and 1.1.

Community
  • 1
  • 1
Daniel Brückner
  • 59,031
  • 16
  • 99
  • 143
  • 1
    There are other features that depend solely on the C# version: for instance, the `var` keyword can be used with the .NET Framework 2.0 even though it was introduced in C# 3. – zneak Jul 05 '10 at 22:22
  • Of course - I just tried to pick one good example for all the cases but I am not really satisfied with my choices. – Daniel Brückner Jul 05 '10 at 22:29
4

I'd go with C# 4.0

The first and third book you quoted refers to the visual studio subproduct (Visual C#), That's why they are using 2010 as the "version" number.

So since you you are going to write an article about C#, not Visual Studio, It's either 4 or 4.0. And since '4.0' makes it clearer that you are talking about a version number, C# 4.0 seems like the best choice to me.

Adrian Grigore
  • 33,034
  • 36
  • 130
  • 210
  • So if I am going to publish a video training which teaches the C# 4.0 language and in the video I use "Visual C# 2010 Express" and "Visual Web Developer Express" to do this, then the video should be called "Visual C# 2010"? What is it that "Visual C# 2010" has that "C# 4.0" doesn't have? Or, when would one ever practically use C# 4.0 without using Visual Studio? – Edward Tanguay Jul 05 '10 at 07:39
  • If using Mono|SharpDevelop, for example. More features than Express, cheaper than VS... – mavnn Jul 05 '10 at 07:49
  • or as ho1 suggested, does "Visual C# 2010" actually refer to the Visual Studio software itself *when it is used to program in C#* and the language itself is always referred to as C# 4.0? – Edward Tanguay Jul 05 '10 at 07:56
  • "The 4.0 refers to the .NET version, which is what actually determines the syntax and semantics of the C# language." is not correct. The version of the .NET Framework is independent from the C# (language) version. – Daniel Brückner Jul 05 '10 at 08:02
  • @Daniel Brückner: "The version of the .NET Framework is independent from the C# (language) version": What do you mean by that? The .NET version does determine the syntax and semantics of the C# language. – Adrian Grigore Jul 05 '10 at 19:12
  • I added a response to my answer because it became way to large for comments. I hope this clarifies my point. – Daniel Brückner Jul 05 '10 at 22:22
  • @Daniel Brückner: Sorry Daniel, but even after reading your answer I still don't get your point. What I meant is that if you are using .NET 4.0 to compile C# code, you can rely on a well defined syntax and semantics of the C# language. For example you can rely on LINQ being supported in C#, because that's part of .NET 4.0. Can you name any example where my assumption would be wrong? – Adrian Grigore Jul 05 '10 at 23:06
  • The C# compiler just produces CIL code. This is completely independent from what happens when the CLR executes this code - the .NET Framework does not influence the C# compiler or determine the C# syntax and semantics. Although the installed .NET Framework version limits the set of C# features that you can execute after compilation. – Daniel Brückner Jul 05 '10 at 23:48
  • @Adrian: you can use C# LINQ with .NET 2.0/3.5 - see http://www.albahari.com/nutshell/linqbridge.aspx. You can also use any C# 4.0 features that do not require library support on .NET 2.0/3.5 immediately (e.g. `var`, lambdas etc). That is to say, while .NET 4 includes Visual C# compiler that supports C# 4.0 language, the output of that compiler is not generally tied to .NET 4. – Pavel Minaev Jul 06 '10 at 02:58
  • @Pavel Minaev, @Daniel Brückner: Point taken. I've deleted that sentence from my answer. – Adrian Grigore Jul 06 '10 at 04:38
3

The official name of the language is Visual C# <version>

I'll look for a reference .


Edit:

The ECMA-334 standard consistently calls it C#. So that is the name of the language.

Microsoft calls their implementation Visual C#. The other implementations (that I know of) are Mono C# and Rotor C#

And while the IDE is called Visual Studio <versionyear>, I think C# 2010 is a definite misnomer. But that doesn't lower its marketing value.

H H
  • 263,252
  • 30
  • 330
  • 514
  • That's a slightly new variation. It's starting to seem like you can just pick any of these names you want to use. Have any of you who have authored books or articles had discussions on which name was correct to use for your particular topic? – Edward Tanguay Jul 05 '10 at 08:51
  • @Edward: I think yes. While C#2010 is officially nonsense, it still could help sell a book. – H H Jul 05 '10 at 09:32
  • Your reasoning makes sense, which means that the Apress book title "Visual C# 2010 Recipes", the topic of which is almost entirely about ways to use the language C# 4.0 per se and not about ways to use the Visual Studio 2010 IDE, is a misnomer. I think the most accurate title for that book would be "C# 4.0 Recipes". – Edward Tanguay Jul 05 '10 at 09:53
  • FYI, there is a product called "Microsoft Visual C# 2010 Express", so, no, it's not nonsense. – Pavel Minaev Jul 05 '10 at 23:36
  • @Pavel, I read that as "Microsoft Visual [Studio] C# (2010 Express)". There is no 'Express' version of the language, only of Visual studio. – H H Jul 06 '10 at 06:34
  • @Henk: see my answer to this question. – Pavel Minaev Jul 06 '10 at 14:57
2

While the real technical name is C# 4.0 for the latest C# version, 2010 is the IDE's version.

For marketing purposes, 2010 might be used instead of 4.0, because people new to the language might be more tempted to the year number for it indicates that the book is tackling the technology with its recent update.

SiN
  • 3,704
  • 2
  • 31
  • 36
  • 1
    +1 that is a good point to simply use "2010" to suggest state-of-the-artness, since I haven't found a technical difference between the languages "Visual C# 2010" and "C# 4.0" yet. – Edward Tanguay Jul 05 '10 at 07:43
  • @Edward: the difference is in minor deviations from the spec, such as the ability to cast `int[]` to `uint[]` and back, as well as language extensions such as `__arglist`. – Pavel Minaev Jul 05 '10 at 23:37
1

I would opt for C#4.0.

In the past you had

  • .NET 1.0 (C# 1.0)
  • .NET 1.1 (C# 1.0)
  • .NET 2.0 (C# 2.0)
  • .NET 3.0 (C# 2.0)
  • .NET 3.5 (C# 3.0)

and now

  • .NET 4.0 (C# 4.0)
Kris van der Mast
  • 16,343
  • 8
  • 39
  • 61
  • that seems the most consistent, yet I first saw "C# 3" and "C# 4" in Jon Skeet's book (I think he even mentioned why he chose these terms but don't have the book on me at the moment) and since then have been seeing "C# 4" and ".NET 4" more often. – Edward Tanguay Jul 05 '10 at 07:34
  • .NET Framework 4 and C# 4 are in fact the correct (as defined by MS) terms _for this version of C#/.NET_ (and .NET 4.0 and C# 4.0 are incorrect). – Pavel Minaev Jul 05 '10 at 23:43
  • thanks pavel, your answers above seems authoritative, but regarding "C# 4.0" being incorrect, you mention above that in "%ProgramFiles%\Microsoft Visual Studio 10.0\VC#\Specifications\1033\CSharp Language Specification.doc", on the very first page it says "C# Language Specification, Version 4.0". Do you have a link to a Microsoft site which states that ".NET Framework 4 and C# 4 are in fact the correct", since you also mention above "The language is C# 4.0." – Edward Tanguay Jul 06 '10 at 03:06
  • Well, it's interesting like that. All marketing docs that I've seen uses ".NET 4" and "C# 4" and so on. Reminds me of Java 5 version 1.5.0 :) – Pavel Minaev Jul 06 '10 at 14:59
1

I'd say the language is C# 4.0, the tool is Visual C# 2010 (like Visual C# 2010 Express).

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
1

The language is C# 4.0. The product is Visual C# 2010.

C:\Users\pminaev>csc /?

Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1

and then opening "%ProgramFiles%\Microsoft Visual Studio 10.0\VC#\Specifications\1033\CSharp Language Specification.doc", on the very first page

C# Language Specification

Version 4.0

Community
  • 1
  • 1
Pavel Minaev
  • 99,783
  • 25
  • 219
  • 289
  • Hmm, _that_ product is the compiler. but I'm inclined to agree that compiler==language in this case. – H H Jul 06 '10 at 15:33
  • Why? It's not claimed to be the only compiler for that language, nor a reference implementation for it. The language is as defined by the spec. – Pavel Minaev Jul 07 '10 at 00:25
0

IMHO i would call it by it's version.. so C# 4.0. Previous Versions were called by the same like C# 3.0 etc.

regards

HerrVoennchen
  • 351
  • 1
  • 5
0

Since C# 4.0 came out and currently can only be developed in Visual Studio 2010 (and no other version of VS), people seem to use both terms interchangeably.

Personally, I would rather see C# 4.0, as that is the version of the language, not of the IDE.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • 2
    That's far from true. On Windows, you can happily use csc.exe with VS, and on Linux & Windows you have Mono of course. – Noldorin Jul 05 '10 at 07:33
  • 1
    Come on, @Noldorin, csc and *notepad* is the way forward ;-) – Dan Puzey Jul 05 '10 at 07:40
  • what does the word "Visual" in "Visual C# 2010" mean? simply that you are using C# 4.0 with some version of Visual Studio? And if you use csc.exe then you are not using "Visual C# 2010" but "C# 4.0"? – Edward Tanguay Jul 05 '10 at 07:45
  • @Edward: try running `csc.exe /?`, it'll tell you what it calls itself. – Pavel Minaev Jul 06 '10 at 14:58
0

Using C# 4.0 may be the official name, but especially if your book is targeted to those 'less in the know', than adding 2010 and whatnot may let people know which version of Visual Studio you are talking about. If it's for professionals, you'll have no problem throwing around C# 4, but for beginners, saying C# 2010 will tell them the IDE they need to use. It's clearer, though not official.

Dominic K
  • 6,975
  • 11
  • 53
  • 62