Custom College Term Papers
Custom term papers home
Order custom term papers
Custom term papers faqs
Custom term paper support
Custom term papers help
Custom term papers
 

Computer Term Papers

 

Why C Language?

 

Introduction
C is a high-level programming language developed by Dennis Ritchie at Bell Labs in the mid 1970s. Despite primarily designed as a system programming language, C has established to be a stalwart and flexible language that can be utilized for a variety of applications, from business programs to engineering. C is especially popular language for personal computer programmers as it is somewhat small and occupies less memory than other languages. The first major program written in C was the UNIX operating system. For many years C was complicatedly linked with UNIX. Today, being an important language, is independent of UNIX. Even though it is a high-level language, C is much closer to assembly language than are most other high-level languages. This affinity to the basic machine language allows C programmers to write very effective code. However the low-level nature of C can make the language difficult to use for some types of applications.
 

 

Order Your Computer Term Papers

 

Order Your Custom Term Papers, College Essays and Research Papers

 


History
The C programming language was derived from the typeless language BCPL, but evolved in to a type structure. Constructed on a tiny machine as a tool to better a meager programming environment, it has become one of the important languages of today.
C came into being in the years 1969-1973, in analogous with the early development of the Unix operating system. Additional row of changes topped between 1977 and 1979, when mobility of the Unix system was being shown. The C Programming Language often called the `white book' or `K&R' (Kernighan, 78) emerged. Ultimately, in the 1980s, the ANSI X3J11 formally standardized the language council, which made more changes. Before the early 1980s, whereas compilers endured for a variety of machine architectures and operating systems, the language was nearly solely analogous with Unix. The 1960s were a blustery time for computer systems research at Bell Telephone Laboratories (Ritchie, 78 and Ritchie, 84). The company was flexing out of the Multics project (Organick 75), which had started as a joint venture of MIT, General Electric, and Bell Labs. By 1969, Bell Labs management and researchers, came to accept that the promises of Multics could be brought about only too late and too costly. Even prior to the GE-645 Multics machine was taken away from the premises, an unofficial group, led originally by Ken Thompson, had begun researching options.

Thompson was confronted with a hardware environment confined and Spartan even for the time. The DEC PDP-7 on which the project was initially started 1968 was a machine with 8K 18-bit words of memory and no software helpful. While desirous of using a higher-level language, he wrote the original Unix system in PDP-7 assembler. In the beginning he did not even program on the PDP-7 itself, but employed a set of macros for the GEMAP assembler on a GE-635 machine. A postprocessor created a paper tape decipherable by the PDP-7. The tapes were taken from the GE machine to the PDP-7 for testing prior to a first Unix kernel, an editor, an assembler, command interpreter, and a few utilities like the Unix rm, cat, cp commands were concluded. After which the operating system was self-supporting and programs could be written and tested outside source to paper tape, and development continued on the PDP-7 itself.
After Unix first ran on the PDP-7, in 1969, Doug McIlroy created the new system's first higher level language. TMG is a language for writing compilers, in general TransMoGrifiers, in a top-down, “recursive-descent style” that combines context-free syntax notation with operational elements. McIlroy and Bob Morris had put to use TMG to write the early PL/I compiler for Multics.
 

Order Your Computer Term Papers


Dared by McIlroy's achievement in representing TMG, Thompson destined that Unix required a system programming language. Following a quickly wrecked effort at Fortran, he assembled instead a language of his own, which he called B. B can be believed of as C lacking types. Also, it is BCPL stuffed into 8K bytes of memory. Its name most presumably symbolizes a shrinking of BCPL, although a substitute theory holds that it is derived from Bon (Thompson, 69), a separate language created by Thompson at the time of Multics. BCPL, B, and C all apt resolutely in the conventional procedural family embodied by Fortran and Algol 60. They are specially directed towards system programming, are modest and densely depicted, and are agreeable to interpretation by simple compilers. Conventional computers `close to the machine’ in that the abstractions they introduce is readily grounded in the concrete data types and operations supply them, and they rely on library routines for input-output and other interactions with an operating system. They also use library procedures to specify interesting control constructs such as croutons and procedure closures, though with less success. At the same instance, the theory lies at an adequately high level that, with care, mobility between machines can be attained.


Going a step further, Thompson invented the ++ and -- operators, which increment or Decrements as their prefix or postfix position determines whichever the change occur prior to or later noticing the value of the operand. Even though sporadic thoughts about instituting one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project appeared pointlessly large for meeting the resources. The machines on which BCPL was initially used and then B were word-addressed, and these languages' single data type, the `cell,' easily balanced with the hardware machine word. The approach of the PDP-11 laid open several failings of B's semantic archetype. Foremost, its character-handling mechanisms, innate with few corrections from BCPL, were awkward, and used library procedures to diffuse packed strings into individual cells and then repack, or to access and substitute individual characters, started to feel clumsy, on a byte-oriented machine. Subsequently, despite the original PDP-11 did not furnish for floating-point arithmetic, the originator promised that it would shortly be obtainable. Floating-point operations was included to BCPL in Multics and GCOS compilers by outlining special operators, but the mechanism was conceivable alone as on the pertinent machines, a single word was big enough to contain a floating-point number. But this was not true on the 16-bit PDP-11.

At length, the B and BCPL model suggested overhead in dealing with pointers, the language rules, by defining a pointer as an index in an array of words, compelled pointers to be symbolized as word indices. Every pointer referral created a run-time scale transformation from the pointer to the byte address anticipated by the hardware. Thus, it appeared that a typing scheme was essential to contend with characters and byte addressing, and to arrange for the arriving floating-point hardware. The issues of type safety and interface checking became important at a later stage. Apart from the doubts with the language itself, the B compiler's threaded-code technique transferred programs so much delayed than their assembly-language counterparts that the possibility of recoding the operating system or its central utilities in B was discounted.
NB (C) endureed so concisely that no broad report of it was written. It furnished the types int and char, arrays of them, and pointers to them, professed in a style typified by
 

int i, j;
char c, d;
int iarray[10];
int ipointer[];
char carray[10];
char cpointer[];
 

Order Your Computer Term Papers

 

The semantics of arrays continued precisely as in B and BCPL. The assertions of iarray and carray originate cells robustly initialized with a value detailing to the first of a sequence of 10 integers and characters specifically. The assertions for ipointer and cpointer exclude the size, to contend that no storage should be alloted uncontrollably. Inside procedures, the language's explanation of the pointers was exactly alike to that of the array variables: a pointer assertion constructed a cell discordant from an array assertion only in that the programmer was anticipated to allocate a contact, instead of chartering the compiler assign the range and initialize the cell. Values stored in the cells restrict to array and pointer names were the machine addresses, ascertained in bytes, of the analogous storage area. Accordingly, indirection via a pointer hinted at no run-time above to scale the pointer from word to byte balance. Conversely, the machine codes for array subscripting and pointer arithmetic now adhered on the type of the array or the pointer.


These semantics symbolized a moderate changeover from B. Doubts became evident when type notation was extended, especially to add structured (record) types. The next innovation that most certainly demarcates C from its predecessors is this broad type structure and particularly its expression in the syntax of declarations. NB gave the key types int and char, simultaneously with arrays of them, and pointers to them, but no other ways of organization. Resolution was needed as given an object of any type, it should be conceivable to depict a new object that pleated various into an array, produces it from a function, or is a pointer to it. For every object of that kind, there was by this time a way to naming the elementary object that is indexing the array, call the function, and use the indirection operator on the pointer. Comparison inference led to declaration syntax for names pretending that of the expression syntax in which the names commonly appear. Thus,


int i, *pi, **ppi;
 

Express an integer, a pointer to an integer, a pointer to a pointer to an integer. The syntax of these expressions give the observation that i, *pi, and **ppi all yield an int type when used in an expression. Similarly,

int f(), *f(), (*f)();

Express a function returning an integer, a function returning a pointer to an integer, a pointer to a function returning an integer;

int *api[10], (*pai)[10];

Express an array of pointers to integers, and a pointer to an array of integers.
 

All in all these cases declare that the variable corresponds its usage in an expression whose type is the one named at the head of the declaration. The design of type organization embraced by C due substantial liability to Algol 68, despite it did not, maybe, emanate in a form that Algol's methods would appreciate of. The main opinion that was taken from Algol was a type structure based on atomic types that included structures, constituted into arrays, pointers, and functions. Following the type system, the analogous syntax, and the compiler for the new language the name of NB seemed unsatisfactorily distinctive. Then the name of C (single-letter) was decided, leaving open the question whether the name represented a progression through the alphabet or through the letters in BCPL. Swift alterations protracted after the language had been named, for instance the beginning of the && and || operators. In BCPL and B, the assessment of phrases rests on appendage, that is within if and other contingent statements that collate an expression's value with zero, these languages place a specific interpretation on the and (&) and or (|) operators. In everyday appendages, they work in bites, but in the B statement


if (e1 & e2) ...
 

Order Your Computer Term Papers


The compiler must appraise e1 and if it is non-zero, appraise e2, and if it too is non-zero, refine the declaration contingent on the if. The necessity sinks on & and | operators within e1 and e2. The short circuit semantics of the Boolean operators in such `truth-value' appendage appeared advantageous, but the overburdening of the operators was hard to elucidate and operate. Then, the && and || operators to make the mechanism more clear were introduced.


Their late introduction elucidates an unhappiness of C's preference rules. In B one writes
if (a==b & c) ...

To check certainly a equals b and c is non-zero; in such a contingent expression it is preferred that & have lower preference than ==. In adapting from B to C, one needs to substitute & by && in such a statement; to make the transformation less arduous, it was decided to keep the preference of the & operator the same relative to ==, and only break the preference of && a little from &. Now, it seems that it would have been favorable to move the relative preference of & and ==, and thereby clarify a conjoint C expression, so as to test a masked value against another value, one must write


if ((a&mask) == b) ...

The fundamentals of modern C were complete by early 1973. The language and compiler were powerful enough to allow the rewrite of the Unix kernel for the PDP-11 in C. The accomplishment of the mobility experiment on the Interdata 8/32 soon led to another by Tom London and John Reiser on the DEC VAX 11/780. This machine became very popular than the Interdata, and Unix and the C language began to spread speedily, both within AT&T and exterior. Even though by the middle 1970s Unix was in use by a diversity of projects within the Bell System as well as a small group of research-oriented industrial, academic, and government organizations outside the company, its actual development began except after portability had been concluded. Of specific interest were the System III and System V versions of the system from the emerging Computer Systems division of AT&T, based on work by the company's development and research groups, and the BSD series of releases by the University of California at Berkeley that derived from research organizations in Bell Laboratories.

Meanwhile, in 1980s the use of the C language spread at large, and compilers became accessible on almost every machine architecture and operating system. In specific it became acclaimed as a programming tool for personal computers, both for manufacturers of commercial software for these machines, and for end-users interesting in programming. Thus and so, almost every compiler was based on Johnson's pcc; by 1985 there were many separately produced compiler products.
C and even B languages have several direct descendants, albeit they do not rival Pascal in originating descendants. More up-to-date descendants of C proper comprise Concurrent C (Gehani, 89), Objective C (Cox, 86), C* (Thinking, 90), and especially C++ (Stroustrup, 86). Besodes, the language is widely used as an intermediate representation, basically, as a portable assembly language, for a wide variety of compilers, both for direct descendents like C++, and independent languages like Modula 3 [Nelson 91] and Eiffel [Meyer 88].


Despite, the relationship between pointers and arrays is odd, it can be learned. Furthermore, the language shows substantial power to depict significant concepts, for instance, vectors whose length varies at run time, with only a few basic rules and conventions. Principally, character strings are palpated by the same mechanisms as any other array, added to the assembly that a null character terminates a string. It is engaging to compare C's approach with that of two all but coexisting languages, Algol 68 and Pascal (Jensen, 74) and FORTRAN and COBOL. Arrays in Algol 68 either has established frontiers, or are `flexible:' Substantial mechanism is required both in the language definition, and in compilers, to assist flexible arrays. Primary Pascal had only fixed-sized arrays and strings, and this proved restrictive (Kernighan, 81). Subsequently, this was somewhat fixed, although the resultant language is not yet entirely accessible.

 

Order Your Computer Term Papers


C treats strings as arrays of characters formally concluded by a symbol. Apart from one certain rule about initialization by string literal, the semantics of strings are completely comprised by more general rules controlling all arrays, and as an outcome the language is clear to explicate and to interpret than one collocating the string as a sole data type. Some costs accumulate from its approach. That is a few string operations are more expensive than in other designs because application code or a library routine must infrequently search for the end of a string, because few built-in operations are obtainable, and since the weight of storage management for strings falls more heavily on the user. However, C's approach to strings works well.

On the contrary, C's handling of arrays in general, not just strings, has unlucky connotations both for optimization and for morrow extensions. The predominance of pointers in C programs, even if those declared categorically or arising from arrays, means that optimizers must be careful, and must use cautious data flow techniques to accomplish good results. Practical compilers can comprehend what most pointers can likely change, but some important usage remains difficult to analyze.
In a like manner, C itself furnishes two duration of storage:
• The `automatic' objects that endure while control resides in or below a program
• The `static,' existing all over implementation of a program

Only a library routine and the burden of provide dynamically allocated storage managing that it is placed on the programmer: C is hostile to automatic garbage collection. At the end, notwithstanding the changes that it has underwent since its first noted narration, which was affirmed colloquial and imperfect, the true C language as seen by millions of users using many different compilers has remained eminently established and associated compared to those of similarly widespread currency, for example Pascal and Fortran. There are incompatible dialects of C most noticeably, those described by the older K&R and the newer Standard C, but on the totality, C has remained sovereign of restrictive extensions than other languages. Conceivably the most important extensions are the `far' and `near' pointer qualifications meant to deal with peculiarities of some Intel processors. Even though C was not primarily designed with portability as a primary objective, it consummated in expressing programs, even as well as operating systems, on machines ranging from the least personal computers through the mightiest supercomputers.

Why better than others, some positives and negatives
Here are some positive and negative aspects of differentiation of C Language with other language like FORTRAN 77
Positive:
• Pointers
• Wide Use
• Lots of Good, Cheap Compilers Available
• Recursion
• Data Structures
• Flexibility
• Handles Dynamic Properties Better
• Better Development Tools
• Bit Juggling
• Easier to Catch Simple-minded Typos
• Flow Control
• Better support for large projects

Negative:
• Clumsy Error Checking
• Absence of Exponentiation Operator
• Absence of Complex Data Type
• Pointers Harder to Learn
• Pointers
• Difficult to Optimize
• Difficult to Vectorize

All of the new things in Tektronix's Cache software is done in C. The preexisting applications (ZINDO, MOPAC, etc.) are in Fortran as ever. Though there is no consensus yet among scientific programmers in general that C is much superior and everyone should go off and rewrite everything. Presumably more new scientific applications are now being written in C than formerly. People use C for portability (both among workstations and to PC's) and it sure beats using BASIC. As you may know, there is FORTRAN to C converters for anybody wanting to laterally crocheting. Furthermore, FORTRAN is less portable than C, and didn't do forking or MIMD applications well.

 

Order Your Computer Term Papers


The biggest strength of C++ (direct descendent of C) is presumably the availability of relatively inexpensive and high quality C++ compilers for PCs. For the development of the program COMPRES the C language was used. This was by reason of that C offers dynamic memory management and has advantages from a software-engineering point of view. Where as people who use Pascal for serious programming fall into a fatal trap. Since the language (Pascal) is so powerless, it must be extended. But each group stretch out Pascal in its own direction, to make it look like whatever language they really want. Extensions for individual compilation, Fortran-like COMMON, string data types, internal static variables, initialization, octal numbers, bit operators, etc., all add to the utility of the language for one group, but destroy its portability to others.

Other implications of C language are:
First, as the size of an array is part of its type, it is not conceivable to write routines, that is, to deal with arrays of different sizes. In specific, string handling is very laborious. Second, absence of static variables, initialization and a way to communicate non-hierarchically combine to destroy the ``locality'' of a program - variables require much more scope than they ought to. Third, the nature of the language forces procedures and functions to be presented in an unnatural order; the enforced separation of various declarations scatters program components that logically belong together. Fourth, absence of separate compilation impedes the development of large programs and makes the use of libraries impossible. Fifth, order of logical expression evaluation cannot be controlled, which leads to convoluted code and extraneous variables. Sixth, case' statement is emasculated because there is no default clause. Seventh, standard I/O is defective. There is no sensible provision for dealing with files or program arguments as part of the standard language, and no extension mechanism. And lastly, other language lacks most of the tools needed for assembling large programs, most notably file inclusion.

References

American National Standards Institute, American National Standard for Information Systems­Programming Language C, X3.159-1989.

B. Anderson, `Type syntax in the language C: an object lesson in syntactic innovation,' SIGPLAN Notices 15 (3), March, 1980, pp. 21-27.

J. R. Bell, `Threaded Code,' C. ACM 16 (6), pp. 370-372.

R. H. Canaday and D. M. Ritchie, `Bell Laboratories BCPL,' AT&T Bell Laboratories internal memorandum, May, 1969.

F. J. Corbato, M. Merwin-Dagget, R. C. Daley, `An Experimental Time-sharing System,' AFIPS Conf. Proc. SJCC, 1962, pp. 335-344.

B. J. Cox and A. J. Novobilski, Object-Oriented Programming: An Evolutionary Approach, Addison-Wesley: Reading, Mass., 1986. Second edition, 1991.

N. H. Gehani and W. D. Roome, Concurrent C, Silicon Press: Summit, NJ, 1989.

K. Jensen and N. Wirth, Pascal User Manual and Report, Springer-Verlag: New York, Heidelberg, Berlin. Second Edition, 1974.

S. C. Johnson and B. W. Kernighan, `The Programming Language B,' Comp. Sci. Tech. Report #8, AT&T Bell Laboratories (January 1973).

S. C. Johnson and D. M. Ritchie, `Portability of C Programs and the UNIX System,' Bell Sys. Tech. J. 57 (6) (part 2), July-Aug, 1978.

S. C. Johnson, `A Portable Compiler: Theory and Practice,' Proc. 5th ACM POPL Symposium (January 1978).

S. C. Johnson, `Yet another compiler-compiler,' in Unix Programmer's Manual, Seventh Edition, Vol. 2A, M. D. McIlroy and B. W. Kernighan, eds. AT&T Bell Laboratories: Murray Hill, NJ, 1979.

S. C. Johnson, `Lint, a Program Checker,' in Unix Programmer's Manual, Seventh Edition, Vol. 2B, M. D. McIlroy and B. W. Kernighan, eds. AT&T Bell Laboratories: Murray Hill, NJ, 1979.

B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall: Englewood Cliffs, NJ, 1978. Second edition, 1988.

B. W. Kernighan, `Why Pascal is not my favorite programming language,' Comp. Sci-Tech. Rep. #100, AT&T Bell Laboratories, 1981.

M. E. Lesk, `A Portable I/O Package,' AT&T Bell Laboratories internal memorandum ca. 1973.

T. MacDonald, `Arrays of variable length,' J. C Lang. Trans 1 (3), Dec. 1989, pp.215-233.

R. M. McClure, `TMG­A Syntax Directed Compiler,' Proc. 20th ACM National Conf.(1965), pp. 262-274.

M. D. McIlroy, `Macro Instruction Extensions of Compiler Languages,' C. ACM 3 (4), pp. 214-220.
M. D. McIlroy and B. W. Kernighan, eds, Unix Programmer's Manual, Seventh Edition, Vol. I, AT&T Bell Laboratories: Murray Hill, NJ, 1979.

B. Meyer, Object-oriented Software Construction, Prentice-Hall: Englewood Cliffs, NJ, 1988.

G. Nelson, Systems Programming with Modula-3, Prentice-Hall: Englewood Cliffs, NJ, 1991.

E. I. Organick, The Multics System: An Examination of its Structure, MIT Press: Cambridge, Mass., 1975.

M. Richards, `The BCPL Reference Manual,' MIT Project MAC Memorandum M-352, July 1967.

M. Richards and C. Whitbey-Strevens, BCPL: The Language and its Compiler, Cambridge Univ. Press: Cambridge, 1979.

D. M. Ritchie, `UNIX: A Retrospective,' Bell Sys. Tech. J. 57 (6) (part 2), July-Aug, 1978.

D. M. Ritchie, `The Evolution of the UNIX Time-sharing System,' AT&T Bell Labs. Tech. J. 63 (8) (part 2), Oct. 1984.

D. M. Ritchie, `Variable-size arrays in C,' J. C Lang. Trans. 2 (2), Sept. 1990, pp. 81-86.

R. Sethi, `Uniform syntax for type expressions and declarators,' Softw. Prac. and Exp. 11 (6), June 1981, pp. 623-628.

A. Snyder, A Portable Compiler for the Language C, MIT: Cambridge, Mass., 1974.

J. E. Stoy and C. Strachey, ’OS6­An experimental operating system for a small computer. Part I: General principles and structure,' Comp J. 15, (Aug. 1972), pp. 117-124.

B. Stroustrup, The C++ Programming Language, Addison-Wesley: Reading, Mass.,1986. Second edition, 1991.

C. P. Thacker, E. M. McCreight, B. W. Lampson, R. F. Sproull, D. R. Boggs, `Alto: A Personal Computer,' in Computer Structures: Principles and Examples, D. Sieworek, C. G. Bell, A. Newell, McGraw-Hill: New York, 1982.

C* Programming Guide, Thinking Machines Corp.: Cambridge Mass., 1990.

K. Thompson, `Bon­an Interactive Language,' undated AT&T Bell Laboratories internal memorandum (ca. 1969).

A. van Wijngaarden, B. J. Mailloux, J. E. Peck, C. H. Koster, M. Sintzoff, C. Lindsey, L.G. Meertens, R. G. Fisker, `Revised report on the algorithmic language Algol 68,' Acta Informatica 5, pp. 1-236.

Feuer, A. R. and N. H. Gehani, ``A Comparison of the Programming Languages C and Pascal - Part I: Language Concepts,'' Bell Labs internal memorandum (September 1979).

N. H. Gehani and A. R. Feuer, ``A Comparison of the Programming Languages C and Pascal - Part II: Program Properties and Programming Domains,'' Bell Labs internal memorandum (February 1980).

P. Mateti, ``Pascal versus C: A Subjective Comparison,'' Language Design and Programming Methodology Symposium, Springer-Verlag, Sydney, Australia (September 1979).

A. Springer, ``A Comparison of Language C and Pascal,'' IBM Technical Report G320-2128, Cambridge Scientific Center (August 1979).

B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, Reading, Mass.(1976).

K. Jensen, Pascal User Manual and Report, Springer-Verlag (1978). (2nd edition.)

David V. Moffat, ``A Categorized Pascal Bibliography,'' SIGPLAN Notices 15(10), pp.63-75 (October 1980).

A. N. Habermann, ``Critical Comments on the Programming Language Pascal,'' Acta Informatica 3, pp. 47-57 (1973).

O. Lecarme and P. Desjardins, ``More Comments on the Programming Language Pascal,''Acta Informatica 4, pp. 231-243 (1975).

H. J. Boom and E. DeJong, ``A Critical Comparison of Several Programming Language Implementations,'' Software Practice and Experience 10(6), pp. 435-473 (June 1980).

N. Wirth, ``An Assessment of the Programming Language Pascal,'' IEEE Transactions on Software Engineering SE-1(2), pp. 192-198 (June, 1975).

O. Lecarme and P. Desjardins, ibid, p. 239.

A. M. Addyman, ``A Draft Proposal for Pascal,'' SIGPLAN Notices 15(4), pp. 1-66 (April 1980).

J. Welsh, W. J. Sneeringer, and C. A. R. Hoare, `Ambiguities and Insecurities in Pascal,'' Software Practice and Experience 7, pp. 685-696 (1977).

J. D. Gannon and J. J. Horning, ``Language Design for Programming Reliability,'' IEEE Trans. Software Engineering SE-1(2), pp. 179-191 (June 1975).

J. D. Ichbiah, et al, ``Rationale for the Design of the Ada Programming Language,''SIGPLAN Notices 14(6) (June 1979).

J. Welsh, W. J. Sneeringer, and C. A. R. Hoare, ibid.

B. W. Kernighan and P. J. Plauger, Software Tools in Pascal, Addison-Wesley (1981).
 

 

Order Your Custom Term Papers, College Essays and Research Papers

 

 


College Term Papers - Order Term Papers - FAQs - Support - Why Us? - Free Writing Resources

Copyright © 2009 WritingServicesCompany.com. All Rights Reserved.

Disclaimer: We provide custom writing services for assistance purposes only. All papers should be used with proper references.