Talk:C (programming language)/Archive 11: Difference between revisions

Content deleted Content added
MiszaBot I (talk | contribs)
m Robot: Archiving 14 threads from Talk:C (programming language). (ARCHIVE FULL)
 
MalnadachBot (talk | contribs)
m Replaced obsolete font tags and reduced Lint errors. (Task 12)
Line 149:
 
Why do people prefer <code>lang="text"</code> instead of <code>lang="c"</code>? [[User:ThePCKid|ThePCKid]] ([[User talk:ThePCKid|talk]]) 23:54, 8 May 2010 (UTC)
:Some people don't like the particular highlighting scheme MediaWiki uses for C. I don't agree, but anyway... --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 00:31, 9 May 2010 (UTC)
:: I like the highlighting... <nowiki>~</nowiki>[[User:ThePCKid|ThePCKid]] ([[User talk:ThePCKid|talk]]) 03:43, 9 May 2010 (UTC)
:::Well, you can try and apply [[WP:BRD]] and see if the consensus has changed / will change. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 04:17, 9 May 2010 (UTC)
:::: [http://en.wikipedia.org/wiki/Talk:C_(programming_language)#why_not_lang.3D.22c.22.3F Discussion higher up on the page] - [[User:Richfife|Richfife]] ([[User talk:Richfife|talk]]) 06:22, 9 May 2010 (UTC)
:A meta-answer is that syntax highlighting is not part of the programming language; it's at best a crutch and at worst a nuisance. — [[User:DAGwyn|DAGwyn]] ([[User talk:DAGwyn|talk]]) 02:57, 13 May 2010 (UTC)
::But it's an extremely useful and widely used crutch. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 08:50, 13 May 2010 (UTC)
 
:::My 2&cent; worth: Minimalism ([[KISS principle|KISS]]): Keywords should be bold and/or colored, comments should be italic, and everything else should be normal text. For example:
Line 244:
 
: The beauty or lack of same of the colors is not the point. The point is that '''a C program is a sequence of characters''', and the character set used does not include differently-colored characters. Presenting examples of the programming language with colors that are not a part of the language definition would be grossly misleading; the language definition does not attach meanings to colors, and therefore a program is the same no matter which colors one chooses to display each character with. We should not pretend to our readers that the language is something it isn't. –[[User:Henning Makholm|Henning Makholm]] ([[User talk:Henning Makholm|talk]]) 22:29, 12 October 2010 (UTC)
::{{ec}}That is completely ridiculous. Almost every other programming lang article for which highlighting is supported utilizes it. Next to no one thinks syntax highlighting is somehow part of language definitions. And in practice, programmers almost always use editors that do syntax highlighting. Whether the coloring is ugly and whether that ugliness should be considered WRT using highlighting, are other issues entirely however. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 23:31, 12 October 2010 (UTC)
::Well, any programming language is 'a sequence of characters'. The same argument can be applied to almost every digital object, we could read Wikipedia in its source form, but why should the regular reader? Would wikipedia be among the most visited webpages on the internet? I guess no. Seeing such a response after such a minor change I think I won't argue anymore. Maybe it's better that our readers chose C++ instead of C. It has examples that look better after all. [[User:1exec1|1exec1]] ([[User talk:1exec1|talk]]) 00:45, 13 October 2010 (UTC)
:@1exec1: It is often better to go along with the consensus, particularly for trivia like this. Please leave the article in its established state (which I strongly support). [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 23:27, 12 October 2010 (UTC)
Line 296:
:::::: (1) Whitespace is certainly part of the input stream to the language implementation that the language standard explains how to interpret. The fact that the language definition explicitly says that whitespace is ignored (except when it isn't, such as in string/character constants, or between identifiers/keywords) ''underscores'' this. In contrast, language definitions do not need to specify that the compiler ignores the color of characters, exactly because ''from the language's point of view, characters do not have any colors to ignore in the first place.''
:::::: (2) Correct. Articles about programming languages that are defined without a notion of character colors should not use colored characters in their examples. –[[User:Henning Makholm|Henning Makholm]] ([[User talk:Henning Makholm|talk]]) 17:50, 16 October 2010 (UTC)
:::::::So then since the language definition ignores whitespace, how do we choose what whitespace to use? By adopting whatever the convention is in that language's community, hence why we don't have everything on 1 line. I submit that using syntax highlighting is likewise conventional, and that C programmers not using highlighting fall into a distinct minority. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 18:19, 16 October 2010 (UTC)
:::::::: The language definition ''doesn't'' ignore whitespace. It explicitly describes whitespace as being part of the input to the compiler. The examples in the article are examples of input to the compiler; therefore whitespace is apropriate in the examples. However, the input to the compiler is not colored; therefore color is not something that is appropriate to include in the examples. –[[User:Henning Makholm|Henning Makholm]] ([[User talk:Henning Makholm|talk]]) 18:43, 16 October 2010 (UTC)
:::::::::Regardless of what we term the compiler's treatment of whitespace, how do you explain the choice to include the specific whitespace that the current article does? Also, fonts aren't input into the compiler either, so by your logic we don't need to make the code in monospaced either. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 19:12, 16 October 2010 (UTC)
 
:::::::::The examples in the article (and the article itself, actually) are not intended for language lawyers. Using C's specification as an argument completely misses the point: the colors are intended to clarify different parts of the code for readers new to the language. They won't look at them and think "Gee, I wonder whether those colors have a defined semantic in C's specification. Also, I better look up how my compiler's parser has to handle whitespace." Now I can understand that there is resistance against using the MediaWiki C colors, but saying that there should not be any syntax highlighting really goes against accepted consensus. – [[User:Adrianwn|Adrian Willenbücher]] ([[User talk:Adrianwn|talk]]) 23:45, 16 October 2010 (UTC)
: I'm recusing myself from this topic. As a personal policy, I never participate in a debate for more than a year. - [[User:Richfife|Richfife]] ([[User talk:Richfife|talk]]) 18:02, 13 October 2010 (UTC)
:+1 on using syntax highlighting ''like every other popular programming language article''. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 18:13, 16 October 2010 (UTC)
:+1 here as well. The argument "the C compiler doesn't understand colors so we shouldn't show colors" is ludicrous, akin to saying that chemistry articles shouldn't show molecular structure diagrams because that's not what atoms really look like. Bravo Cybercobra for bold execution. &mdash;[[User:Chaos5023|chaos5023]] ([[User talk:Chaos5023|talk]]) 21:37, 29 October 2010 (UTC)
 
Line 314:
 
:::Well, I'm not suggesting we are required to follow sources for this issue, but it's worth considering, especially since there appears to be no consensus on this issue. And I say that without knowing what the latest books on ''C'' (are there any?) are doing. But why not follow the editorial judgment of reliable sources? After all, if it is deemed to effectively convey the information in texts designed to convey the information, why should we do something different? --[[User:Born2cycle|Born2cycle]] ([[User talk:Born2cycle|talk]]) 23:46, 4 November 2010 (UTC)
::::Few programming books are printed in color; we have no way of knowing whether they'd colorize it if they were to print in color. --[[User:Cybercobra|<b><font colorstyle="color:#3773A5;">Cyber</font></b><fontspan colorstyle="color:#FFB521;">cobra</fontspan>]] [[User talk:Cybercobra|(talk)]] 00:05, 5 November 2010 (UTC)
 
::::I went through the A, B and C sections of [[List_of_programming_languages]], and counted articles with syntax highlighting. Of the 149 items in the A/B/C lists, 73 included code samples of some sort, of which 43 (59%) had some form of syntax highlighting (colors, bolding, fonts, underlines). If we eliminated short articles or articles with very short code samples (in a few cases there was only a *single* line of unhighlighted sample code), the percentage would be higher. While there are certainly longer articles and longer samples without syntax highlighting ([[Cobol]], for example), there is a definite additional bias towards having syntax highlighting in those cases. I don't believe that any of those languages use that highlighting in a syntactically or semantically meaningful way, and it exists only to provide clarity to the reader. Also, several languages clearly related to C (B, C++, C#, for example), also use syntax highlighting in their examples. So I think there's definitely something approximating a consensus that syntax highlighting in the code samples in the articles on programming languages is generally a good thing. [[User:Rwessel|Rwessel]] ([[User talk:Rwessel|talk]]) 06:08, 5 November 2010 (UTC)