Content deleted Content added
Derek farn (talk | contribs) →Tools for mitigating issues with C: Reworked precompiled headers |
various supposed improvements had problems |
||
Line 16:
C does not have some features that are available in some other programming languages:
* No assignment of arrays or strings (copying can be done via standard functions; assignment of objects having <code>struct</code> or <code>union</code> type is supported)
* No [[Garbage collection (computer science)|automatic garbage collection]]
* No requirement for [[bounds checking]] of arrays
* No [[array programming|operations on whole arrays]]
Line 78:
* Not checking number and types of arguments when the function declaration has an empty parameter list. (This provides [[backward compatibility]] with [[The C Programming Language (book)|K&R C]], which lacked prototypes.)
* Some questionable choices of operator precedence, as mentioned by Kernighan and Ritchie above, such as <code>==</code> binding more tightly than <code>&</code> and <code>|</code> in expressions like <code>x & 1 == 0</code>.
* The use of the <code>=</code> operator, used in mathematics for equality, to indicate assignment, following the precedent of [[Fortran]], [[PL/I]], and [[BASIC]], but unlike [[ALGOL]] and its derivatives. Ritchie made this syntax design decision consciously, based primarily on the argument that assignment occurs more often than comparison
* Similarity of the assignment and equality operators (<code>=</code> and <code>==</code>), making it easy to substitute one for the other
* A lack of [[infix notation|infix]] operators for complex objects, particularly for string operations, making programs which rely heavily on these operations difficult to read.
* A declaration syntax that some find unintuitive, particularly for [[function pointer]]s. (Ritchie's idea was to declare identifiers in contexts resembling their use: "[[declaration reflects use]]".)
Line 150:
There are dialects of C, such as [[Objective-C]] and [[Cyclone programming language|Cyclone]], that address some of these concerns.
Many compilers, notably [[Visual C++]] and [[Xcode]], reduce the long compilation times caused by very large [[header file]]s by using ''[[precompiled header]]s'', a system where the contents of a header are stored in an form designed to be much quicker to process than source text. The one-time
It should be recognized that these tools are not a [[
== See also ==
|