Jump to content

Talk:C Sharp (programming language)/Archive 3

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wbm1058 (talk | contribs) at 20:41, 13 February 2013 (moving sections archived out-of-sequence to Talk:C Sharp (programming language)/Archive 1). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2Archive 3

Template:Archivenav

The Programmers joke is boring

I didn't like the section with the programmer's joke, and now its been revised to something even more convoluted and contrived. I'd like to delete it. Comments? Leotohill 03:21, 14 June 2006 (UTC)

I rewrote and shortened it. It could still use a source, though. What do you think? Deco 02:35, 14 June 2006 (UTC)
It's better. Thanks. Leotohill 03:21, 14 June 2006 (UTC)

Politics: Don't confuse C# with the .NET framework.

I've removed a couple of sentences from the section.

"The relevant patents covering the .NET implementation were released for public use. "

I'm not sure that this is true or correctly phrased. "Released for public use" is not the right language for a patent. Can anyone provide a reference to this claim about patents?

"However, the standard library provided with C#, including the extensive GUI library, is not open or completely documented, so an independant implementation which can run all programs written for Microsoft's C# would be difficult and of questionable legal basis "

C# is a specification. No library is provided with it. This statement confuses C# with the .NET framework. C#, the specification, does not require the framework. It does not even require the CLR (CLI).

We need to divide this topic into two parts, or separate topics. One is C#, the specification. This would describe the characteristics of the language free of .NET framework context. The second topic would be "Microsoft C#". This would describe Microsoft's implementation of the spec, and could freely use .NET framework elements in the examples and other text.

Leotohill 21:32, 14 June 2006 (UTC)

Also, I believe the correct name for Microsoft's implementation is "Microsoft Visual C#." Even the commandline compiler (csc.exe) refers to itself in this way. —TheMuuj Talk 21:55, 14 June 2006 (UTC)
The correct wording would be "licensed freely for public use", or something like that. Yes, parts of the article referring to Microsoft's specific implementation should be qualified as such. Deco 00:23, 15 June 2006 (UTC)

New article "Microsoft Visual C#"

Ok, I've gone and done it, that which we discussed. I've created Microsoft Visual C_Sharp. Let's work on moving all content that is specific to Visual C# to that article. LeoTohill June 17 2006

I've added a "design goals" section. It's taken verbatim from the ECMA standard. I'd usually try to avoid direct copies but a) I couldn't find any rephrasing, trimming, or expansion that would improve it and b) it's not copyrighted. Leotohill 21:29, 18 June 2006 (UTC)

In retrospect, there really is very little or nothing in this article that needs to be moved to Microsoft Visual C_Sharp. That article will probably remain quite short, just describing the distinction between this and that. But I think it's useful, and should not be merged.—The preceding unsigned comment was added by Leotohill (talkcontribs) .

Well, other than being completely incorrect, that is. "Visual C#" isn't an implementation of the ECMA spec. Visual C#, in fact, uses the compiler implementation found in the Microsoft .NET Framework — the same C# implementation used in Borland Delphi, SharpDevelop, and other IDEs. Visual C# is an IDE, not a compiler implementation. It's really something of a misnomer since the product is actually named Visual Studio, but as Microsoft themselves use the name it's OK to have it here. I scarcely know where to begin with that article. --Craig Stuntz 16:28, 5 July 2006 (UTC)
Except that when you run the C# compiler that comes with the .NET Framework, it identifies itself as "Microsoft (R) Visual C# .NET Compiler." So the .NET Framework comes with the free Visual C# compiler (even though the name "Visual" is dubious), and various Visual C#/Studio products (Express, Standard, Professional) come with IDEs for running the compiler. I do fully intend to contribute to both this and the Microsoft Visual C# articles in the future, and having to re-split the information will be a huge pain. I'd say that if anything Visual C# should be merged with Microsoft Visual Studio, but then the information would be harder to find. —TheMuuj Talk 19:23, 5 July 2006 (UTC)
MS's utter self-confusing regarding the names of ".NET"-branded products are a matter of public record. But it's clear from the MS link I give above what MS means when they talk about "Visual C#" in general. I agree that merging VC# and MSVS makes sense. The correct place to discuss MS's compiler, in my opinion, is in Microsoft .NET Framework, since the framework is the only place to get it, with or without VS. Oh, and some original research: I have it from sources I trust that a number of people involved with Visual Studio never really considered the fact that other people would make an IDE for .NET. This actually explains quite a bit, like the fact that the WinForms designer comes with the framework, but the designer for WinForms on Compact Framework does not. --Craig Stuntz 20:20, 5 July 2006 (UTC)
Craig, the url you provided has a lot of content. Can you be more specific about what part of it supports your opinion? I see only statements for the opposite, such as this at http://msdn.microsoft.com/vcsharp/learning/default.aspx
"  Before you can get started writing any code at all, you are going to need some software. Generally speaking you need two things:
   * The Visual C# compiler to turn your programs into running applications. This is available as part of the .NET Framework SDK (a free download)
   * Some form of editor or IDE (Integrated Development Environment) in which to write your code."
They seem to be clear about it: Visual C# is NOT the IDE.
Leotohill 21:49, 5 July 2006 (UTC)
Also, Craig, I think that you are incorrect on another point. The .NET framework does not include the C# compiler. The content of the framework is clearly defined in .NET Framework, and can be verified at http://msdn.microsoft.com/netframework/gettingstarted/default.aspx . The C# compiler is included in the framework Software Development Kit (SDK).
Leotohill 22:07, 5 July 2006 (UTC)
I'm almost certain that you get the C# and VB compilers when installing just the .NET Framework. I don't install the SDK on most machines, and often rely on being able to use notepad and csc.exe in a pinch. With .NET 2.0, I believe MSBuild comes with the framework, whether or not it is actually a "part" of it (it's in the Microsoft namespace instead of System, for starters). —TheMuuj Talk 22:30, 5 July 2006 (UTC)
That may be true - I'll have to test that on a clean machine. But in any case, since the MS doc is very clear about the definition of the fw, and that definition does not include the compiler(s), I don't think the fw topic should include MSVS.
Leotohill 00:12, 6 July 2006 (UTC)
I actually intended to say the SDK when I said "framework," although I believe TheMuuj is correct that it's included with both. As for links from that page supporting what I say, well, [1]. But yes the SDK is where nearly all IDEs supporting C# on Windows get the compiler, including Visual Studio. --Craig Stuntz 00:24, 6 July 2006 (UTC)

Reverted Removal of "C Pound"

I reverted the changes by 70.17.32.75 that removed a sub-section about how C# is sometimes pronounced (see C_Sharp#Language_name). I don't think the edit was vandalism, but I don't think it should be removed without discussion, either. Feel free to remove it again, but include an explanation of why it should be removed. I have heard people refer to the language by the names mentioned, so it is not a factual error. However, if the information is not encylopedic or otherwise violates policy, then by all means re-remove it. —TheMuuj Talk 05:48, 20 June 2006 (UTC)

I think it should be removed. It's trivial and distracting. (perhaps move it to a "Trivia" section?) Also, I never heard the symbol referred to as "gate". Maybe it is, but not enough to cause confusion. Leotohill 11:56, 20 June 2006 (UTC)
Trivia sections are the garbage pile of Wikipedia. Since its inception, C# was always defined (and publicized) as being pronouced "c-sharp". Any other pronounciation as always been done after-the-fact and jokingly. --Spookfish 02:47, 20 July 2006 (UTC)

System.Console is not technically an Object

The Hello world example section states:

Console is a system object, representing a command-line console where a program can input and output text.

This may be a bit pedantic of me, but technically Console is a static class, and therefore there is never an "object" of that type. This is different from Java, where System is the static class and Console() returns an object, but in .NET, Console mostly consists of helper methods that call methods on Console.In and Console.Out. It's probably helpful to think of it as an object, and the design is a simpler way to implement the singleton pattern (rather than something like Console.Instance.WriteLine). But is it correct to call it an object? I don't know how to change it without making it confusing, so I'll leave it as is. —TheMuuj Talk 21:50, 21 June 2006 (UTC)

Speaking of "pedanticity," there is no System.Console() method in Java. There are three fields of System: in, out, and err (which can be reassigned to redirect output/input/error). --Chris (talk) 23:10, 21 June 2006 (UTC)
Actually, there is (or will be) a System.console() method, but it appears to be still in draft. (See JDK 1.6 Spec). I did get the capitalization wrong, but that was out of habit. —TheMuuj Talk 23:24, 21 June 2006 (UTC)
Why are you comparing currently released .NET aspects with yet-to-be-finalized aspects of a still-under-development Java? Secondly, static class methods can be thought of as methods of a singleton (global instance) object of that class. The concept of "object" doesn't just apply to class instances... a Java "Class" instance is proof of that since there can only be one instance of it per class definition. --Spookfish 02:31, 20 July 2006 (UTC)
I'd be ok with changing it to "Console is a system class, ..." Leotohill 03:48, 22 June 2006 (UTC)

I don't think this will ever happen, but...

What if someone creates a language called C Flat?? What would the symbol be?? Georgia guy 23:26, 7 July 2006 (UTC)

Any serious computer language takes a lot of effort to develop. No serious developer(s) would go to that trouble to only then call it some joke/pun-on-words name. It would certainly result in no one taking it seriously enough to do any major development with. --Spookfish 02:52, 20 July 2006 (UTC)
I would imagine "Cb." Or "B" if you wanted to be really clever. —TheMuuj Talk 02:08, 8 July 2006 (UTC)
Ah, but there already was a B. Deco 02:36, 8 July 2006 (UTC)
So C-flat would be a .NET implementation of Bell Labs B? —TheMuuj Talk 02:55, 8 July 2006 (UTC)

User User talk:71.252.197.197 has spent the last five days inserting this link [2] in the C# and Microsoft .NET Framework pages. He argues that his website is more relevant than the other thousands of C# websites out there. I don't have a problem with that, but someone other than him/her must also agree that the site is encyclopedic and relevant enough to be included in the list of external links. Any takers? -- klaus

That's any unfair characterization of my argument. It's not that it's more relevant than all the other sites, simply that it is relevant.--70.104.16.183 17:24, 18 October 2006 (UTC)
I should add that the site is not even indexed by Google [3] -- klaus
Not so, Klaus. --70.104.16.183 17:20, 18 October 2006 (UTC)

The site does not appear "commercial" at first glance (no ads, etc, though it may be used to advertise certain books). To be honest, I'm on the fence about this one. It's probably something I would use once the site has more content. It seems to properly distinguish between C# and Visual C#, so it is a candidate for this article. But really I don't know. (It's worth mentioning that the site doesn't use a free license on the content -- they reserve all of the content under their copyright. This isn't relevant to inclusion, just something interesting to point out.) --Chris (talk) 19:05, 27 July 2006 (UTC)

It's a bit of a two edged sword, Chris. No links, no traffic, no content--for a wiki-based site. Besides, you must be used to vast sites. I think almost 1,300 pages in a few months is pretty good and fast growing. --70.104.16.183 17:20, 18 October 2006 (UTC)

why this link does not meet the criteria for external links:

  • C# Online.NET - free, wiki-based C# and .NET encyclopedia and forums

but these do:

--70.104.16.183 17:20, 18 October 2006 (UTC)

Personally, I'd say that neither is sufficiently relevant. I don't think we need more than one "community" link anyway, and that one should preferrably be the most prominent C# community site. Those are often wikis, true (consider CLiki), but apparently not in this case (yet, anyway). Considering how fast wikis tend to grow, it would get some leeway in my opinion if it were a true wiki, but it's neither Free (copyright to all contributions is assigned to creators of that page, and they explicitly reserve the right to deny access to information to anyone they please, and use it for any purpose, including commercial) nor ad-free (plenty of Google text ads). So, my say would still be no. And remove the other two links as well, unless someone gives a convincing reason for why they are there. -- int19h 05:23, 20 December 2006 (UTC)

Possibility of weak typing

It is obvious C# is normally strongly typed, but doesn't it allow for weak typing using the implicit type casts a programmer can specify? Shouldn't we note that in the Typing discipline part of the box at the top of the page? --85.145.148.191 02:46, 30 July 2006 (UTC)

I thought that it was generally accepted practice for implicit casts to only be used for widening conversions, which really doesn't make C# any more weakly typed. Most strongly-typed languages allow for widening conversions, because there's less potential for bugs to spring up. There is the possibility of writing a Variant-like class that's like a tagged union and can be implicitly cast to any of the primitive types, but I still don't think that would make C# weakly typed, because you'd still be explicitly specifying the casting behavior somewhere in code. So the weak type behavior would still be limited to classes that are designed that way, and not any classes/types. —TheMuuj Talk 04:45, 30 July 2006 (UTC)

Actually, it's quite possible to do (limited) tagged variants with implicit casting in C#, by defining implicit conversion operators. Consider this code:

struct Variant
{
  private object value;
  
  // int
  
  private Variant(int value)
  {
    this.value = value;
  }
  
  public static implicit operator Variant(int value)
  {
    return new Variant(value);
  }
  
  public static implicit operator int(Variant v)
  {
    return (int)v.value;
  }
  
  // string
  
  private Variant(string value)
  {
    this.value = value;
  }
  
  public static implicit operator Variant(string value)
  {
    return new Variant(value);
  }
  
  public static implicit operator string(Variant v)
  {
    return (string)v.value;
  }

  // ...
}

So it can certainly be done for a finite set of types (i.e. all primitive types). Unfortunately, since there's no way to define generic conversion operators, you cannot do something like boost::variant in C#, nor can you make a variant type which could be implicitly converted to/from any other C# type. -- int19h 07:35, 15 October 2006 (UTC)

"The public static void portion is a subject for a slightly more advanced discussion."

Then either link to one, or provide an external link! Loganberry (Talk) 03:15, 9 September 2006 (UTC)

Microsoft's implementation

We say both:

This article describes the language as defined in the ECMA and ISO standards, and avoids description of Microsoft's implementation. For a description of Microsoft's implementation, see Microsoft Visual C#

and

the Microsoft implementation of C# is by far the predominant one, and this article describes its characteristics and behavior, unless noted otherwise

This is confusing, and somewhat contradictory. — Matt Crypto 11:38, 25 September 2006 (UTC)

I tried to make the article focus more on the ECMA standard and less on MS quirks in the recent cleanup edit, so I've removed the "this article describes its [Microsoft's implementation] characteristics and behavior, unless noted otherwise" statement and "contradictory" tag for now. But I'll appreciate if someone takes another look and checks if nothing of a kind has managed to slip past. -- int19h 12:33, 28 September 2006 (UTC)
Thanks for looking at that, cheers. — Matt Crypto 19:39, 28 September 2006 (UTC)

XML Documentation?

Should this page mention the XML documentation mechanism? What is that called, anyway? I don't think that the XML documentation is specific to Visual Studio, either; it was mentioned in an appendix of the C sharp standard, as a recommendation, I think or something like that. 68.198.48.49 03:21, 14 October 2006 (UTC)

Yes, it is part of the standard, so it should probably go in here as well as the Java/C# comparison page. I'll try to come up with something. -- int19h 07:19, 15 October 2006 (UTC)
I've done it. The section is pretty minimalistic as it is. Does something like this deserve its own article? Javadoc has an article. 68.198.48.49 18:37, 23 October 2006 (UTC)
I've expanded it a bit with info about standardization. Even so, it's pretty short (which is perfectly okay - we're not describing the language in detail here), so I don't think a separate article is worth the bother. Not sure why Javadoc has one, actually - it looks like it would be better placed in the main Java article. -- int19h 07:28, 24 October 2006 (UTC)
There's also the question of whether or not linking to other documenters, even by way of an example (I'm thinking of NDoc here), might not also be a good idea. NDoc, in my humble experience, is a pretty popular way of doing code documentation and adds a few tags to the "standard" which one can find in sample code occasionally. Whether it's popular enough to be characterized as a de facto 'standard' is another matter. Does it matter if one points to examples where NDoc tags seemed which were not implemented in .NET Framework v1.1 seem to have been embraced in v2.0 & later? ross613 19:40, 25 January 2007 (UTC)

"He can be cited in interviews"

Does anyone else find this wording strange: "He can be cited in interviews and technical papers as stating flaws in most major programming languages". Is there a better way to say this? I can't think of one off the top of my head though. Timbatron 04:59, 23 October 2006 (UTC)

Factual Error

"EMCA" and "ISO" standards are unadopted standards. C# is a Microsoft product; any other variations can not be considered C#.

What, are you next going to replace the Microsoft Windows article with an article about WINE and then put 'Microsoft's implementation' in a different article? —The preceding unsigned comment was added by 137.45.72.17 (talk) 02:11, 13 February 2007 (UTC).

I don't understand what you are trying to say here, or what you mean by "unadopted standards". Leotohill 02:31, 13 February 2007 (UTC)
C# is a language standardized by ISO and ECMA. Microsoft product is called Visual C#, and it fully implements those standards. Other implementations of the standards are Rotor by Microsoft, and Mono and DotGNU by third parties. With four widely known implementations in existence, I fail to see how the standards are in any way "unadopted". -- int19h 06:26, 13 February 2007 (UTC)

C# - play on words?

The term C# is a play on words similar to the language name C++: the expression C++ in the language C means C incremented by one, and the author of C++ named the language C++ in reference to its incremental improvement over C, while the sharp in 'C#' implies that it is a 'step up' from C. A sharp symbol can be broken apart into four plus signs, so the name C# might be rendered as C++++, and the meaning being that it is C++ incremented by one.

There's no source for this. Is this original research? - furrykef (Talk at me) 19:42, 12 March 2007 (UTC)

Good for you, for removing it. All these theories about the meaning of the name are just speculation, afaikt. Here's another one: "The name is meant to suggest 'see sharp(ly)', as in having acute vision or knowledge." I just made that up, but it's as good as the others. Wait, here's another: "The name is a double pun on 'The sea is flat'" . It means that C# is the language for navigating seas that are not flat (i.e., are sharp)." Wait, here's another... oh, never mind. Leotohill 01:18, 13 March 2007 (UTC)

The fact that two themes of logic come together in this way does not have to be original research. Too quick to delete is the privaledge of the not so bright. I would be happy to ready sharp (ly) and the 'sea is flat' but doing it in discussion RoddyYoung 09:16, 31 March 2007 (UTC)

This section keeps being re-added with sources that are not reliable. All of the sources I have seen are tutorials making speculation along the "someone once said..." lines. This is not an appropriate citation. We have an email from Microsoft, the authority on this subject, stating definitively where the name of the language comes from -- this is a primary source. I will continue to remove content that claims that "#" is made up of "++++" unless there is a proper citation. --Chris (talk) 16:18, 6 May 2007 (UTC)

C# is actually a recycled project name at Microsoft. There was a language development project at Microsoft from 1988 to 1990 or so that used this name, headed by Scott Randell and Charles Simonyi, that was canceled. So any history of the name that doesn't come from a member of the original C# team is not authoritative. Charles can be reached at intentsoft.com for verification (I suggest someone write him, and if he responds, placing the response on a web site where it can be cited). Having said that, it was recognized within Microsoft at the time that the octothorp was made of four plus signs. Since the name came into use at Microsoft before the establishment of Unicode, there wasn't the distinction between the sharp symbol and the octothorp in the characters available at the time. 209.221.185.146 11:24, 27 September 2007 (UTC)

Coding style

The recent edits have, among other things, changed the coding style to Java-like "braces on same line as statement", with edit description of "consistent with the most common style". I would argue that it is by no means the most common style for C# - Microsoft's coding style is doubtlessly the most prevalent, being described in MSDN, used in all their examples and demo programs, and enforced by default in Visual Studio - and it does put braces on separate lines. So I think that's what we should do here as well. -- int19h 08:18, 23 April 2007 (UTC)

I'm not sure how you got the impression it is Microsoft's or MSDN's style to use "braces on separate lines". AFAIK nearly all of their examples, including those in the Visual Studio documentation and online (random example), use the more compact style. About the Visual Studio setting, I'm not sure about that, and can't really confirm it without a reinstall. But in the end that's just a setting. For small code samples like this though, the "brace on same line" style imho prevents the examples from cluttering the article. (The readability of the examples themselves is entirely subjective.) – Chip Zero 09:20, 23 April 2007 (UTC)
It looks like they're changing it then. In my copy of MSDN that came with VS2005, I cannot find a single example written in such style. I just tried looking for "examples (C#)" in the Index, and then going through them one by one - same thing, they all show a very consistent style, with braces as in ANSI C style, separate lines. Here is the "official" collection of Microsoft samples for C# - how about looking there for guidelines on the style? I'll do it myself as well, as soon as I have a little bit more time. -- int19h 17:18, 23 April 2007 (UTC)
Looks like they aren't as consistent as I thought then; never really noticed they also have examples in "brace on separate line" style. All the examples in the main API help section – basically any non-trivial method has one - seem to be "brace on same line". – Chip Zero 19:38, 23 April 2007 (UTC)

Compiler as a Service

If this article is truly about the C# language, then I do not believe Compiler as a Service should have to be mentioned under C# 5.0. This is completely implementation-specific; for example, Novell's Mono has had CaaS for a long time. --Zor (talk) 07:15, 6 April 2011 (UTC)

ECMA standard update

http://www.ecma-international.org/publications/standards/Ecma-335.htm has been updated so the standards note about C#4 not being standard should be updated —Preceding unsigned comment added by 31.147.29.236 (talk) 01:21, 14 April 2011 (UTC)

Article title

Wouldn't it be closer to reality to use a sharp sign in the article title in place of the forbidden hash; rather than the word "Sharp"?--Kotniski (talk) 08:43, 24 September 2010 (UTC)

You can't have a # character in an article title as that character is used by the html spec to represent a section in a page. It might be possible to use ♯ (U+266F) but that goes against the the convention of writing the name, it is also hard to type. C♯ programming language does redirect here.--Salix (talk): 09:53, 24 September 2010 (UTC)
The technical limitation per the # has less to do with URIs (where it can be quoted as %23) than wikilinks (where it would be a bit messier).
What i find nonsensical is a template flatly declaring that the correct title of the article is "C# (programming language)", when the name of the language is actually C♯. I've always viewed C# to be a secondary spelling; but seeing as it's canonised in the spec as an official alternate (indeed, used almost exclusively), i suppose it's acceptable as the article title. (It just seems suboptimal.)
überRegenbogen (talk) 22:36, 29 January 2011 (UTC)
It has been discussed many time in the past see /Archive 2 and was featured in Wikipedia:Lamest edit wars so I'd rather not got back there.--Salix (talk): 10:10, 24 September 2010 (UTC)
I don't really understand the arguments though. No-one needs to type the symbol (except once, when doing the page move), and the sharp sign is much closer to the conventional way of writing the name than the word "Sharp" is. It seems silly to have the notice at the top saying what the "correct name" of the article is, when we have the technical capacity to represent that correct name almost perfectly.--Kotniski (talk) 10:36, 24 September 2010 (UTC)
But that's explicitly not the conventional way of writing the name (emphasis added):

Due to technical limitations of display (standard fonts, browsers, etc.) and the fact that the sharp symbol (♯, U+266F, MUSIC SHARP SIGN) is not present on the standard keyboard, the number sign (#, U+0023, NUMBER SIGN) was chosen to represent the sharp symbol in the written name of the programming language.[9]

--Cybercobra (talk) 05:38, 26 September 2010 (UTC)
Yes, and we can't use the number sign, so we have to use something else. And the sharp sign looks a lot more like the number sign than the word "Sharp" does.--Kotniski (talk) 09:05, 26 September 2010 (UTC)
I fail to understand how this is even a discussion when we have an article on the musical note C♯. We should be using it in the programming language page as well. Any and all "chosen representations" are nonetheless still sub-optimal. NJDevils1087 (talk) 13:49, 3 May 2011 (UTC)
I agree. Anybody want to post a move request? –CWenger (^@) 17:50, 3 May 2011 (UTC)

C# as a Declarative Language

At the beginning, it is stated that C# is multi-paradigmed including ... declarative ... . Could someone expand on this a bit? The only declarative language I've used is MetaFont. Having used C# a good deal, I must say that what I know of declarative programming (from MetaFont) doesn't exist in C#. I'm happy to say that I don't understand declarative programming, but if I have any idea of what it is, C# does not support it, or I don't understand in what ways C# supports declarative paradigms.

--Limited Atonement (talk) 14:42, 18 April 2011 (UTC)

The LINQ syntax is primarily what people mean by "declarative", in the same sense that SQL is a declarative language. Attributes are also kinda-sorta declarative if you stretch the definition a bit. :) Maghnus (talk) 03:50, 20 April 2011 (UTC)


WPF's xaml is also declarative. --Sanisoclem (talk) 09:21, 3 May 2011 (UTC)

Requested move

The following discussion is an archived discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section.

The result of the move request was: Not moved. Jafeluv (talk) 09:49, 10 May 2011 (UTC)


C Sharp (programming language)C♯ (programming language)C♯ (programming language) – The official and common name of the programming language appears to be C# (with a number sign). But that name is not possible due to technical restrictions. We should try to represent it as closely as possible. The sharp sign (♯) is certainly much closer than the word "Sharp", and since the name is derived from the musical notation, it is logical as well as practical. It is difficult to type the sharp sign but redirects can handle that. The most important thing is to have the title at the top of the page match what the user is expecting as nearly as possible. –CWenger (^@) 19:10, 3 May 2011 (UTC)

The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.

question on Hello World example

Is there an error in this text?

class Program
Above is a class definition. Everything between the following pair of braces describes Program.

static void Main()
This declares the class member method where the program begins execution. The .NET runtime calls the Main method. (Note: Main may also be called from elsewhere, like any other method, e.g. from another method of ExampleClass.) The static keyword makes the method accessible without an instance of ExampleClass.

Should it really say ExampleClass here, or maybe Program class? The only place I see ExampleClass is up in the Generics section. Sorry if this is a dumb question, I am just learning C# - BollyJeff || talk 19:27, 2 September 2011 (UTC)

 Fixed. Thanks! --Cybercobra (talk) 23:17, 2 September 2011 (UTC)

Unity 3D

I believe Unity 3D should be taken off the list of "implementations". It's not an implementation, but merely uses C# as a scripting language (if my memory serves me right, through Mono's tooling). --87.55.108.124 (talk) 04:41, 28 November 2010 (UTC)

Considering there have been no objections, I will make this change... --Zor (talk) 07:16, 6 April 2011 (UTC)
I don't see why it had to be removed. Unity is a relatively popular and well-known tool. And even a scripting language can be considered an "implemenation" no? They have their own libraries and what not. And I don't know what is meant my "Mono's tooling", they do include Mono develop for help with programming, but you can just as easily use Visual Studio, or, like with Javascript, you can just open up a plaintext editor and program. 128.238.242.212 (talk) 00:54, 28 April 2011 (UTC)
An implementation consists of such things as a compiler and a virtual machine. Unity 3d does not provide its own, it uses the ones provided by Mono. -- 98.108.202.17 (talk) 07:55, 21 November 2011 (UTC)

Hellow World example : GUI

The GUI example for the Hello-World-Program will not work stand-alone. Hello-World-Programs are supposed to have no dependencies outside of the given code. The code for the intended example would in fact be:

using System;
using System.Windows.Forms;

namespace Whatever_Namespace
{
	static class Program
	{
		[STAThread]
		static void Main(string[] args)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Application.Run(new Form1());
		}
	}

	public class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			MessageBox.Show("Hello World", "Hello");
		}

		private System.ComponentModel.IContainer components = null;

		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void InitializeComponent()
		{
			this.button1 = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.button1.Location = new System.Drawing.Point(0, 0);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(250, 50);
			this.button1.TabIndex = 0;
			this.button1.Text = "Button";
			this.button1.UseVisualStyleBackColor = true;
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// Form1
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(250, 50);
			this.Controls.Add(this.button1);
			this.Name = "Form1";
			this.Text = "Hello World";
			this.ResumeLayout(false);
		}

		private System.Windows.Forms.Button button1;
	}
}

The .NET Framework will only always run the Main() method in the Program class to launch an application, no matter whether it is a console application or a windows forms application. ♆ CUSH ♆ 12:08, 28 November 2011 (UTC)

Also, a Hello world program is supposed to "one of the simplest programs possible", so the GUI example should simply display the message box when run - not display a form with a button that needs to be clicked to display the message. Ie it should be something like:
...
static void Main(string[] args)
{
     MessageBox.Show("Hello World", "Hello");
}
Mitch Ames (talk) 12:24, 28 November 2011 (UTC)
Well, if an example with a form is wanted, the "simplest program possible" is something like the code I posted. Opening a MessageBox is only a call to the OS, and not a form of the application itself. ♆ CUSH ♆ 12:31, 28 November 2011 (UTC)
A WinForms "Hello world" would be basically a form with a label - no buttons or event handlers. Most of the stuff in the autogenerated InitializeComponent() is also unnecessary for such an example. Maghnus (talk) 19:44, 28 November 2011 (UTC)
A call to Console.WriteLine is "only a call to the OS" as well (as is the call to printf in the original C version of the program, but it is still a valid application. Anything with a Main function is a valid application. It doesn't need to be a Form - a MessageBox is a GUI (ie not a console application). I still assert that my example (corrected if necessary so it compiles cleanly and runs - I haven't tested it, and my C# is not brilliant) is the appropriate one. Mitch Ames (talk) 09:07, 29 November 2011 (UTC)
Strictly speaking, of course neither printf nor MessageBox.Show are "calls to the OS" - both are calls to a library that in turn calls the OS. Mitch Ames (talk) 09:11, 29 November 2011 (UTC)
I reverted to the original version (using MessageBox). I agree that what we have (pre-revert) is misleading. A message box is probably the simplest. We said GUI, not Windows Forms or WPF or whatever, so there's no need to use a Form. T. Canens (talk) 09:17, 29 November 2011 (UTC)
On a side note, while the entry point must be called Main(), it does not have to be in a class called Program. As long as there's only one static method (in any class) fitting the requirement, the C# compiler will use that as the entry point; if there are more than one, a command line switch is needed to tell the compiler which Main() to use. See [4]. T. Canens (talk) 09:21, 29 November 2011 (UTC)

Article name

The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section.

Consider http://zh.wikipedia.org/wiki/C%E2%99%AF It uses C# as the name. - Bevo (talk) 23:00, 21 May 2011 (UTC)

What other languages do doesn't really matter to enwiki. And see the failed Requested Move directly above. --Cybercobra (talk) 01:25, 22 May 2011 (UTC)
I think the real reason here is that # doesn't work as a lookup letter in the Mediawiki database system or PHP or something... The above discussion regarded using the sharp sign ♯, which very well works, but may be a real headache for the users/editors — or not. Rursus dixit. (mbork3!) 17:29, 25 May 2011 (UTC)
The name of the Language is C#, pronounced "see sharp", period. The name is not C Sharp and not C♯. And since Google and other search engines allow searches for C#, Wikipedia ought to as well. Is this the world's most extensive encyclopedia or some noob's private website project? ♆ CUSH ♆ 12:20, 28 November 2011 (UTC)
The technical problem is that the # character has special meaning in the URI standard, so the URL would need to encode the character as %23. That would be fine as far as PHP and the database are concerned. MediaWiki could potentially handle a URL such as http://en.wikipedia.org/wiki/C%23_(programming_language) instead of redirecting to C, but it doesn't. Unless and until they fix the software (not likely, as it's by design), C_Sharp is the best option. Maghnus (talk) 20:16, 28 November 2011 (UTC)
It's hard to come up with a fix that will not screw up section wikilinks (e.g., C#History). It would be really odd if you have to escape the # sign even in wikitext. T. Canens (talk) 09:26, 29 November 2011 (UTC)
The name of the language is C♯, but can be written as C# (view the Visual Studio cover). The only problem here is the possible violation of Manual of Style:
Avoid using special characters that are not pronounced, are included purely for decoration, or simply substitute for English words (e.g., ♥ used for "love"). In the article about a trademark, it is acceptable to use decorative characters the first time the trademark appears, but thereafter, an alternative that follows the standard rules of punctuation should be used.
--Ricvelozo (talk) 18:13, 29 November 2011 (UTC)

The programming language should really be using "C♯" since the "♯" symbol is the sharp sign. C# means "C Number sign" or "C Hash", not "C Sharp". But of course, we use C# because it's actually on the keyboard and can be easily inputted in contrast to the sharp sign, ♯, in which people would have to use the character map or something. Still wrong though. - M0rphzone (talk) 23:18, 7 April 2012 (UTC)

The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

assembly vs namespace

From the section on the hello world example:

In this case, when the compiler sees use of the Console type later in the source code, it tries to find a type named Console, first in the current assembly, followed by all referenced assemblies

I'm pretty sure "assembly" in this sentence is wrong, and should be replaced by "namespace". — Preceding unsigned comment added by 188.74.65.169 (talk) 18:43, 13 December 2011 (UTC)