Talk:C Sharp (programming language)/Archive 3
![]() | This is an archive of past discussions about C Sharp (programming language). Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 |
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):
--Cybercobra (talk) 05:38, 26 September 2010 (UTC)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]
- 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)
- 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)
- 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)
- But that's explicitly not the conventional way of writing the name (emphasis added):
- 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)
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) – 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)
- Weak Support Unable to locate any source explicitly advising against using the sharp sign. --Cybercobra (talk) 23:03, 3 May 2011 (UTC)
- Oppose. Just as we do not substitute the octothorpe in running text when we mean the sharp sign, likewise we should not do the opposite in article titles. Powers T 02:31, 4 May 2011 (UTC)
- We have to substitute something though. Why do you think the word "Sharp" is superior to a ♯ sign? –CWenger (^ • @) 02:34, 4 May 2011 (UTC)
- Because it's accurate to how the name of the product is pronounced. Powers T 11:58, 4 May 2011 (UTC)
- We have to substitute something though. Why do you think the word "Sharp" is superior to a ♯ sign? –CWenger (^ • @) 02:34, 4 May 2011 (UTC)
- Strong oppose It is the wrong character, isn't typable anyways, violates MOS:TM and is WP:ORIGINALRESEARCH. 64.229.100.153 (talk) 04:32, 4 May 2011 (UTC)
- Oppose. We shouldn't be putting the wrong special character into a title just because it happens to resemble the right character. —David Eppstein (talk) 05:49, 4 May 2011 (UTC)
- Oppose; it's not the right character; I think this kind of ascii art is pushing it a little. But shouldn't it be C sharp? ErikHaugen (talk | contribs) 05:58, 4 May 2011 (UTC)
- Eh, it's a proper noun. --Cybercobra (talk) 06:04, 4 May 2011 (UTC)
- Yes of course, nevermind then. ErikHaugen (talk | contribs) 21:20, 4 May 2011 (UTC)
- Eh, it's a proper noun. --Cybercobra (talk) 06:04, 4 May 2011 (UTC)
- Comment WP:TITLE#Special characters is the appropriate policy. I can see the sharp sign just causing endless difficulty with people typing the # in links. Dmcq (talk) 07:28, 4 May 2011 (UTC)
- If anyone would be cognizant of this issue, it would be programmers. And since this is a programming article... --Cybercobra (talk) 09:07, 4 May 2011 (UTC)
- Oppose -- don't need special characters in titles unless you're looking for said character (and even then, it may not be practical). C Sharp is fine; anyone who understands the url spec will probably expect the article to be at this location. I disagree that we "have" to substitute an incorrect character just because it's "closer" — not in meaning, and that's what should be focused on. – anna 12:19, 4 May 2011 (UTC)
- Undecided, leaning towards oppose Although occasionally typeset as C♯ or C♯, Microsoft itself uses C# pretty consistently. Given that the latter is technically impossible and "C hash" wouldn't be very recognizable, we should probably settle for the official pronunciation "C sharp". Not sure if this is a proper name and if the S in sharp should therefore be capitalized or not. —Ruud 10:45, 7 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)
- 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)
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"); }
- 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)
- 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 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 [1]. T. Canens (talk) 09:21, 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)
- 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)
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)
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 namedConsole
, 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)
Module system
The module system including the using
keyword should not be explained in the example section, but rather in its own section. --91.202.129.192 (talk) 12:24, 5 April 2012 (UTC)
Location of the Syntax section
I disagree with this change moving the syntax section to the top. In a general purpose encyclopaedia the details of the syntax are nowhere near the most important information. Do other editors have an opinion on this? Mitch Ames (talk) 10:07, 4 May 2012 (UTC)
- I agree. Syntax is highly tecnical, and per WP:UPFRONT should be after more general sections like history and design goals. I've moved it downwards. Diego (talk) 10:41, 4 May 2012 (UTC)
- Sorry about that. I am new to Wikipedia, and I figured that the article was mainly about what the language is, and not about the context, usage, and development of the language. Obviously, I am not familiar with Wikipedia guidelines enough. Randomizer3 (talk) 14:30, 4 May 2012 (UTC)
- In a wiki about programming, you'd be right. But always have in mind that Wikipedia is for all audiences; someone who is not a programmer (a journalist, a manager) might want to learn what C# is for (as opposed to how it's used), and general sections about context are more informative for most people. Diego (talk) 15:12, 4 May 2012 (UTC)
- Sorry about that. I am new to Wikipedia, and I figured that the article was mainly about what the language is, and not about the context, usage, and development of the language. Obviously, I am not familiar with Wikipedia guidelines enough. Randomizer3 (talk) 14:30, 4 May 2012 (UTC)
Influenced by Java?
Per Neutral Point of View, should the page really state that it influenced Java, as the source even states that, "In my opinion, it is C# that has caused these radical changes to the Java language."
This could be disputed because Java influenced C#, and the source even states that it is one person's opinion. -TheLunarFrog (talk) 22:56, 5 November 2012 (UTC)
- They are contemporary and quite similar languages targeting the same audience. I don't think anyone would dispute there's is some mutual influencing going on here (e.g. Project Lambda). Adding an additional reference e.g. discussing more recent versions of the two languages (Java 7/8, C# 4/5) couldn't hurt, though. —Ruud 00:10, 6 November 2012 (UTC)
Requested move
- The following discussion is an archived discussion of the proposal. 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 proposal was not moved. --BDD (talk) 23:13, 4 February 2013 (UTC) (non-admin closure)
C Sharp (programming language) → C♯ (programming language) – Please put your reason for moving here. Jarble (talk) 04:49, 28 January 2013 (UTC)
- Strong oppose MOS:TM, using a special character -- 65.92.180.137 (talk) 11:52, 29 January 2013 (UTC)
- Strong Oppose. Man, I hate this requests. I really want this to happen because I like the "C♯" look better than "C Sharp". But rules are rules. Via MOS:TM. Srsrox (talk) 16:57, 30 January 2013 (UTC)
- The above discussion is preserved as an archive of the proposal. 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.
implicit with keyword
C# supports strongly typed implicit variable declarations with the keyword
var
Without knowing the form of one of these declarations, I still quibble with calling it an implicit declaration if it uses a keyword. Jmichael ll (talk) 04:40, 28 April 2013 (UTC)
- "strongly, implicitly typed variable declarations" might be better, although it doesn't read well. Eg
var i = 10; // implicitly typed integer
- The type of i is deduced by the compiler from the context, but it is just as strongly typed as if the programmer had specified int explicitly. Mitch Ames (talk) 06:00, 28 April 2013 (UTC)
better reference for Gosling quotes in C# article
The source in footnote (reference) 17 quotes a source that quotes a source.
A better reference for the original source is:
Wylie Wong (2002). "Why Microsoft's C# isn't" CNET News, January 17,2002 available online at: http://news.cnet.com/2100-1082-817522.html
I'm not a wikipedia editor. Can soneone please fix this.
Also a more extended and informative quote would include the second part of Gosling's comments:
"They had this problem in their design rules that they had to support C and C++, which means you have to have a memory model where you can access everything at all times. It's the existence of those loopholes that is the source of security, reliability and productivity problems for developers. So on the one hand, they copied Java, and on the other hand, they added gratuitous things and other things that are outright stupid. That's amusing.”
68.80.26.175 (talk) 23:47, 28 May 2014 (UTC)cherbert@ccp.edu
Thank you for the suggestion, I've replaced the reference as suggested. I did not add the entire quote since I felt like it didn't add much to the section, but if someone else sees value in it they can add it.
Also, there are no designated Wikipedia editors. Anyone can edit Wikipedia (except for some protected pages, of course.)
Pathogen-David (talk) 00:59, 29 May 2014 (UTC)
Sharp Sign Notation
# notation. since when has it been called C hash? the sharp symbol is used at the start of the article, but gets switched to the octothorpe. 50.125.167.6 (talk) 23:20, 6 May 2014 (UTC)
It is extremely common to type C# instead of C♯ because it is easier to type. Even most of the official documentation uses a pound sign instead of a sharp. For example: [2] (This is even covered in the article under the name section.) Pathogen-David (talk) 15:17, 8 May 2014 (UTC)
At work we don't use the musical symbol when using/writing the language, but use the "#" symbol (shift+3 on keyboard). We pronounce the name "see-hash". But I've also heard "see-sharp" as well. I've never heard it called "see-octothorpe", but that's not to say it isn't. By the way, I believe the "pound sign" is something different (£ - England-currency?) — Preceding unsigned comment added by 193.167.170.13 (talk) 14:18, 14 August 2014 (UTC)
"C Sharp" or "C sharp"
Why does "Sharp" have an upper case "S" - should it be lowercase, per MOS:CAPS? Presumable "Sharp" is not actually part of the official name ("C#"), so there's no need to capitalise it.
If it should be capitalised in the article title because it's a proper noun, then it probably ought to be capitalised everywhere throughout the article, in particular C_Sharp_(programming_language)#Name currently has a lower case "S" in
The name "C sharp" was inspired ...