Wednesday, 20 November 2013

CHARACTERISTICS OF ‘C’ LANGUAGE

C programing is widely used in computer technology. Do you know C is the only language which has written its compiler also written in C. Now we can review the characteristics of C language

1) General Purpose Programming Language:
          Programming generally categorized as two types. Application programming and System Programming. In application programming, user writes applications which interact with system software. But in system programming we are writing applications that interact with system hardware. By using C you can develop both these applications.So people are use it widely for this general purpose in development.

2) Middle Level Language:
         C is often called as Middle Level Language. Because it combines high level language elements with low level language functionalism.
         High level language is user friendly, to some extent platform independent, and abstract from low level computer process operations like memory access. where as low level language, is more machine specific and directly dependent with computer process operations like memory access.
         Our C will use high level functionality by functions through re usability, where it can give access to low level memory using pointers.

3) Structured/Modular Programming:
        It is the one of important characteristics of C language. Structured/Modular programing is subset of procedural programming that reduces the need of GOTO statements. C is a Structure programming, by dividing program into modules(functions), which will help reduce writing of same code multiple times by using already defined functions.
      In many ways structured programming is considered as precursor to Object Oriented Programming. 

4) Portability :
       Ability to run application in different environments. With the availability of compilers for almost all operating systems and hardware platforms, it was easy to write code on one system which will run on another system with little changes. But we need to build in that machine with those changes to port the application.

5) Efficient Compilation and Execution:
      Programs written in C are run at the speed that matching to the same programs written in assembly language. This C program compilation also takes lesser time when compared to other programing languages. That's why this language is used for real time applications.

6) Rich set of Library Functions:
       C has a rich set of library functions. These are the functions that provide ready made functionality to the users. It also supports graphic programming.

7) Powerful Programming Language:
      C is very powerful language. It was best used for data structures implementation, compilers design and designing other system software.It provides wide variety of data types, functions, control statements to achieve every thing for an application. It provides pointers to access memory directly as machine level languages.

These are main reasons why we choose C programming language over the other programming language. 


 

Monday, 18 November 2013

History Of C Language

Like many other inventions in history, C language also came from a need. C language evolution is closely related to the UNIX operating system.
History before C:
      In early days computers were used by individually. Bell Laboratories try to provide a operating system for a large computer, on which multiple users can work. For that they began a project called Multics, in which Dennis M. Ritchie and Ken Thompson work together with some other people at 1960s. But Bell Laboratories stop that project in 1969, because this project doesn't provide any economically solution. So that team move onto another project.

Ken Thompson started to work on developing UNIX kernel for PDP-7 machine. He also used B language in parts for implementing UNIX kernel, but most of that is done by the assembly language. By testing their UNIX operating system on PDP-7, Thompson team expects that they can acquire new DEC PDP-11 machine. The processor was among the first of its line delivered by DEC. Thompson recorded Unix kernel and some basic commands for PDP-11 machine. They port that Unix kernel to the DEC machine in 1970. But in 1971, they need to port the Unix kernel to B language. But they faced some problems with B language to implement this.

Issues with B language:
1) B takes word as the only data type, means addressing and declarations are done in machine words. But in PDP-11 machine character handling mechanism(inherited from BCPL ) was clumsy when using B language.
2)PDP-11 also doesn't support floating point arithmetic. But we have implementation of  these floating point arithmetic in B language, but it requires one Word to done that. But this was not true in case of 16 bit PDP-11
3)Finally B language implied overhead in implementing pointer arithmetic, beacuase we need to represent pointers also in words which is not working for 16 bit PDP-11 machine.

Evolution of C:
                   So in 1971, they began to extend the B language by adding new features which are required to compete with assembly language. The language was named as C, as most of the features are derived from B language. The C language had a powerful mix of high-level functionality and the detailed features required to program an operating system. So Unix components are rewritten later with C language.

Ken Thompson and Dennis Ritchie
                    In 1978, Brian Kernighan and Dennis Ritchie published the first edition of The C Programming Language. This book, known to C programmers as "K&R", served for many years as an informal spec of the language. The version of C that it describes is commonly referred to as K&R C. After the publication of the K&R description many  features of C impressed computer professionals. By the mind of 1980 the popularity of C had become widespread. Numerous C compilers and interpreters had been written for different Operating systems.Most of the commercial implementations of C were some what different from K & T version of C. This created some minor incompatibilities among different implementations of the language.

              Therefore, the ANSI (American National Standard Institute) worked on a standard version of C language.In 1988 they delivered the final standard definition ANSI C.Later on, the ANSI C standard was adopted by the International Standards Organization (ISO). The correct term should there fore be ISO C, but everybody still calls it ANSI C.

            Next revision was published in 1999 that introduced new futures like advanced data types and other changes. This is called C-99 Standard.

           C11 standard adds new features to C and library like type generic macros, anonymous structures, improved Unicode support, atomic operations, multi-threading, and bounds-checked functions. It also makes some portions of the existing C99 library optional, and improves compatibility with C++.

           Embedded C includes features not available in normal C like fixed-point arithmetic, named address spaces, and basic I/O hardware addressing