Criticism of the C programming language: Difference between revisions

Content deleted Content added
Line 154:
It should be recognized that these tools are not a panacea. Because of C's flexibility, some types of errors involving misuse of variadic functions, out-of-bounds array indexing, and incorrect [[memory management]] cannot be detected on some architectures without incurring a significant performance penalty. However, some common cases can be recognized and accounted for.
 
The general solution to problems which are caused by the syntactic freedom of C is to use compiler flags (options) which pedantically give warnings on deviant constructions. ItA hasparanoid been observed that C code by programmers who were trained in a strict language (such as Pascal) using structured programming, is easy to read and be maintained. The most difficult C code is from the early period where many programmers wanted to squeeze too much into a cryptic one liner. Today we know that software maintenance is much too costly to allowexample for such eccentricity. As better compilers became available and standard habits of coding as well as standardized code-layout styles have been achieved, many of the disadvantages of C have been alleviated, in practice.
[http://en.wikipedia.org/wiki/GNU_Compiler_Collection GNU gcc] compiler:
 
<pre>
gcc -c -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
-Wcast-qual -Wchar-subscripts -Winline \
-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings myprogram.c
</pre>
 
It has been observed that C code by programmers who were trained in a strict language (such as Pascal) using structured programming, is easy to read and be maintained. The most difficult C code is from the early period where many programmers wanted to squeeze too much into a cryptic one liner. Today we know that software maintenance is much too costly to allow for such eccentricity. As better compilers became available and standard habits of coding as well as standardized code-layout styles have been achieved, many of the disadvantages of C have been alleviated, in practice.
 
== See also ==