Talk:C (programming language): Difference between revisions
comment |
m Archiving 1 discussion(s) to Talk:C (programming language)/Archive 17) (bot |
||
Line 36: | Line 36: | ||
::BTW, WP has articles [[Low-level programming language]] and [[High-level programming language]], but no such thing for middle level (this could have possibly been [[WP:OR]]). — [[User:Vincent Lefèvre|Vincent Lefèvre]] ([[User talk:Vincent Lefèvre|talk]]) 14:13, 12 December 2022 (UTC) |
::BTW, WP has articles [[Low-level programming language]] and [[High-level programming language]], but no such thing for middle level (this could have possibly been [[WP:OR]]). — [[User:Vincent Lefèvre|Vincent Lefèvre]] ([[User talk:Vincent Lefèvre|talk]]) 14:13, 12 December 2022 (UTC) |
||
:::The only way you can @[[User:Gvv57348|Gvv57348xv]] has [[Special:Contributions/108.75.76.176|108.75.76.176]] ([[User talk:108.75.76.176|talk]]) 04:17, 14 May 2023 (UTC) |
:::The only way you can @[[User:Gvv57348|Gvv57348xv]] has [[Special:Contributions/108.75.76.176|108.75.76.176]] ([[User talk:108.75.76.176|talk]]) 04:17, 14 May 2023 (UTC) |
||
==Wiki Education assignment: Linguistics in the Digital Age== |
|||
{{dashboard.wikiedu.org assignment | course = Wikipedia:Wiki_Ed/University_of_Arizona/Linguistics_in_the_Digital_Age_(Spring_2023) | assignments = [[User:ManD01n|ManD01n]] | start_date = 2023-01-11 | end_date = 2023-05-11 }} |
|||
<span class="wikied-assignment" style="font-size:85%;">— Assignment last updated by [[User:Nurbekyuldashov|Nurbekyuldashov]] ([[User talk:Nurbekyuldashov|talk]]) 01:52, 9 May 2023 (UTC)</span> |
|||
== C is a system language, not general purpose == |
== C is a system language, not general purpose == |
Revision as of 00:02, 23 October 2023
This is the talk page for discussing improvements to the C (programming language) article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
This article has not yet been rated on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
|
C (programming language) is a former featured article. Please see the links under Article milestones below for its original nomination page (for older articles, check the nomination archive) and why it was removed. | ||||||||||||||||
| ||||||||||||||||
Current status: Former featured article |
C Intermediate Language was nominated for deletion. The discussion was closed on 29 April 2013 with a consensus to merge. Its contents were merged into C (programming language). The original page is now a redirect to this page. For the contribution history and old versions of the redirected article, please see its history; for its talk page, see here. |
|
|||||||||||||||||
This page has archives. Sections older than 100 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Delete the "middle-level language" part
It's bound to cause confusion on to the nature of C as somewhere between a high-level and low-level language, especially since Low-level programming language #Assembly language names it as a high-level language. One could also argue that middle-level is a fairly vague term that could have a lot of different interpretations. Gvv57348 (talk) 18:06, 11 December 2022 (UTC)
- WP:DIY You may have a good point, IMHO. Chumpih t 20:14, 11 December 2022 (UTC)
-
- BTW, WP has articles Low-level programming language and High-level programming language, but no such thing for middle level (this could have possibly been WP:OR). — Vincent Lefèvre (talk) 14:13, 12 December 2022 (UTC)
- The only way you can @Gvv57348xv has 108.75.76.176 (talk) 04:17, 14 May 2023 (UTC)
- BTW, WP has articles Low-level programming language and High-level programming language, but no such thing for middle level (this could have possibly been WP:OR). — Vincent Lefèvre (talk) 14:13, 12 December 2022 (UTC)
C is a system language, not general purpose
C has system facilities. Any language with low-level facilities should not be use for general-purpose programming. It bakes in dependencies, results in lock in (which C does), and also results in inflexibility.
C also has many primitive facilities like pointers and defines which really have no place in general-purpose programming. Ian.joyner (talk) 20:12, 13 May 2023 (UTC)
- I see you put this on Talk:C++ as well; it is generally wrong, and I'll reply to both comments here. General-purpose programming language is a specific term contrasted with domain-specific languages. C is a general-purpose programming language and you will find this present in nearly any source that discusses it. For instance, the very first sentence of K&R (2nd ed.) says "
C is a general-purpose programming language.
" (page 1; also a near identical sentence is in the preface on p. xi). - The Uses section is a mess and needs some serious cleanup, but it's valid to discuss how it is used; C is widely used outside of systems programming contexts, though, so this change would also be invalid there. Wikipedia is an encyclopedia and not a manual; it would be inappropriate for the article to present an opinion on where C should be deployed in wiki-voice.
- It might be appropriate to present opinions on current usage of C (and C++, in that article). There are several experts in the field who have expressed concerns specifically related to memory safety with the wide deployment of programs written in C and C++—this is far from a universally held opinion though. Note that this would require more research to incorporate; my off-the-cuff anecdote isn't enough, and any change would want to assess appropriate sources (ideally, highly trustworthy secondary sources, especially ones that provide general overviews of the state of the art, such as instructional textbooks). Dylnuge (Talk • Edits) 17:29, 1 September 2023 (UTC)
"Only the last member stored is valid"
In the "overview" section, under "User-defined (typedef) and compound types are possible" Unions are mentioned as "Union is a structure with overlapping members; only the last member stored is valid."
This is not a fair or accurate statement according to the C standard. I believe this may have been written confusing the C standard for the C++ one, in which accessing a union member that was not most recently written to is strictly undefined.
The C standard explicitly allows "type-punning" using unions, but carefully promises that reinterpreting the bit-representation of one type to another may result in an invalid or trap representation.
The following is pulled directly from the C17 standard. It lies in a footnote under section 6.5.2.3.3:
"If the member used to read the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called “type punning”). This might be a trap representation."
The mention of unions should probably be edited to something like "Union is a structure with overlapping members; it allows multiple data types to share the same memory location".
I will leave this note here for a few weeks and if no one objects I will make the edit. WillisHershey (talk) 21:28, 25 September 2023 (UTC)
improving the "hello world" example
Rather than an blind "afaik", a reliable source is needed to alter an example which has a valid reliable source. TEDickey (talk) 10:15, 22 October 2023 (UTC)
- Give in: Meanwhile, I checked the program using gcc 11.4.0 under Ubuntu. It seems the a missing
return
leads to a warning - except inmain()
, so Tedickey is right. As a side remark, I don't see a source given for the 2nd version. - Jochen Burghardt (talk) 10:21, 22 October 2023 (UTC)
- Quoting from ISO/IEC 9899:1999(E), section 5.1.2.2.3 Program termination:
If the return type of the main function is a type compatible with int, a return from the initial call to the main function is equivalent to calling the exit function with the value returned by the main function as its argument; reaching the } that terminates the main function returns a value of 0.
- Perhaps C11 changes that, but again, a WP:RS helps TEDickey (talk) 15:19, 22 October 2023 (UTC)
- Regarding the comment that a diagnostic is required: I don't see that in the standard. Perhaps it's another instance of people confusing a particular implementation with the standard TEDickey (talk) 15:35, 22 October 2023 (UTC)
- C-Class Computing articles
- Top-importance Computing articles
- C-Class software articles
- Top-importance software articles
- C-Class software articles of Top-importance
- All Software articles
- C-Class Computer science articles
- High-importance Computer science articles
- All Computing articles
- WikiProject Computer science articles
- C-Class C/C++ articles
- Top-importance C/C++ articles
- C articles
- WikiProject C/C++ articles
- Wikipedia former featured articles