The
origin of C is closely related to the development of Unix operating system
(OS). The C language was originally developed in 1970’s by Dennis Ritchie at
Bell Laboratories. C is a general purpose structured programming language.
General purpose means can use to develop anything and structured means it has
particular structure to deal with or writing the program. We come to that
latter. C is considered as a low level language that fills the gap between
machine language and high level language. C language is used for system programming
as well as for application programming.
Before we start any complex program in C, we must
understand what really C is, how it came into existence and how it differs from
other languages of that time. In the late
70’s C began to replace widespread well-known languages of that time like PL/I,
ALGOL etc. Programmers everywhere began using it to write all sorts of
programs. Soon, however, different organizations began applying their own
versions of C with a subtle difference. This posed a serious problem for system
developers. To solve this problem, the American National Standards Institute (ANSI) formed a committee in 1983 to establish a standard
definition of C. This committee approved a version of C in 1989 which is known
as ANSI C. With few exceptions, every modern C compiler has the ability to
adhere to this standard. ANSI C was then approved by the International
Standards Organization (ISO) in 1990.
Now, How the name
C ? Why it was named C, why not something else. The C language is so named because
its predecessor was called B. The B language was developed by Ken Thompson of
Bell Labs.
Why C come?
Machines on which
we first used BCPL and then B were word-addressed, and these languages' single
data type, the `cell,' comfortably equated with the hardware machine word. The
advent of the PDP-11 exposed several inadequacies of B's semantic model. First,
its character-handling mechanisms, inherited with few changes from BCPL, were
clumsy: using library procedures to spread packed strings into individual cells
and then repack, or to access and replace individual characters, began to feel
awkward, even silly, on a byte-oriented machine.
Second, although
the original PDP-11 did not provide for floating-point arithmetic, the
manufacturer promised that it would soon be available. Floating-point
operations had been added to BCPL in our Multics and GCOS compilers by defining
special operators, but the mechanism was possible only because on the relevant
machines, a single word was large enough to contain a floating-point number;
this was not true on the 16-bit PDP-11.
Finally, the B and
BCPL model implied overhead in dealing with pointers: the language rules, by
defining a pointer as an index in an array of words, forced pointers to be
represented as word indices. Each pointer reference generated a run-time scale
conversion from the pointer to the byte address expected by the hardware.
For all these
reasons, it seemed that a typing scheme was necessary to cope with characters
and byte addressing, and to prepare for the coming floating-point hardware.
Other issues, particularly type safety and interface checking, did not seem as
important then as they became later.
Aside from the
problems with the language itself, the B compiler's threaded-code technique
yielded programs so much slower than their assembly-language counterparts that
we discounted the possibility of recoding the operating system or its central
utilities in B.
Why C ?
•
Program written in c are very efficient and fast. This is due to its variety of
small data types and powerful operators (arithmetic, logical, conditional etc).
It is many time faster than BASIC. This helps developers in saving their
valuable time.
•
C is a powerful and flexible language which helps system developers to deliver
various complex tasks with ease. C is used for diverse projects as operating
systems, word processors, graphics, spreadsheets, and even compilers for other
languages.
•
C is popular among professional programmers for programming, as a result, a
wide variety of C compilers and helpful accessories are available.
•
C is highly portable language. This means that a C program written for one
computer system (an IBM PC, for example) can be run on another system (a DEC
VAX system, perhaps) with little or no modification. Portability is enhanced by
the ANSI standard for C, the set of rules for C compilers.
•
C’s another striking feature is its ability to extend itself. A C program is
basically a collection of various function supported by C library (also known as header files). We can also add our own functions to the C library. These functions can be reused in other applications or
programs by passing pieces of information to the functions, you can create
useful, reusable code.
•
Writing C program with user-defined functions(UDF) makes program more simple and easy to understand. Breaking
a problem in terms of functions makes program debugging, maintenance and
testing easier.
As
these features shows that C is an excellent choice for your first programming
language. But what is C++? You might have heard this term C++ and the
programming technique called Object-Oriented Programming (OOP).
Possibly you're wondering what the differences are between C and C++ and
whether you should learn C or C++.
C++
is a superset of C, means that C++ is the new improved version of C for the
latest programming needs. It contains everything C does, plus new additions for
OOP concept. If you will learn C++ later, you will find that almost everything
which you learnt in C is applicable in C++ too. In learning C, you are not only
learning one of today's most powerful and popular programming languages, but
you are also preparing yourself for other similar programming languages.
Another
language that has gotten lots of attention is Java for its OOP and portability.
Java, just like C++, is based on C. If later you decide to learn Java, you will
find that almost everything you learned about C applies there.

No comments:
Post a Comment