Social Icons

Saturday, May 19, 2018

Introduction To The C Programming Language
Ken Thompson & Dennis Ritchie

1 - About the C language

The C language is an imperative and generalist programming language. Invented in the early 1970  to rewrite UNIX, C has become one of the most used languages. Many more modern languages ​​like C ++, C #, Java and PHP have aspects of C.
The C language was invented in 1972 at Bell Laboratories. It was developed at the same time as UNIX by Dennis Ritchie and Ken Thompson. Ken Thompson had developed a predecessor of C, the B language, which is itself inspired by BCPL. Dennis Ritchie has evolved the B language into a new version that is quite different, including the types, so that it is called C1.


Although C is officially inspired by B and BCPL, there is a strong influence of PL / I (or PL360); we could say that C was at Unix and PDP-11 what PL / I was for the rewriting of Multics.

Later, Brian Kernighan helped popularize the C language. He also made some last-minute changes.

In 1978, Kernighan was the main author of the book The C Programming Language describing the language finally stabilized; Ritchie took care of appendices and examples with Unix. This book is also called "K & R", and we speak of traditional C or C K & R when referring to the language as it existed at that time.

2 - Main Features

The Clanguage is an imperative and generalist programming language. It is called a low-level language in the sense that each language instruction is designed to be compiled into a fairly predictable number of machine instructions in terms of memory occupancy and computing load. In addition, it offers a range of integer and floating types designed to directly match the types of data supported by the processor. Finally, it makes an intensive use of memory address calculations with the notion of pointer.
Aside from basic types, C supports enumerated, compound, and opaque types. On the other hand, it does not propose any operation that deals directly with higher-level objects (computer file, character string, list, hash table ...). These more advanced types must be handled by manipulating pointers and compound types. Similarly, the language does not offer as standard the management of object-oriented programming or exception management system. There are standard functions for handling I / O and strings, but unlike other languages, there is no specific operator to improve ergonomics. This makes it easy to replace standard functions with functions specifically designed for a given program.

These characteristics make it a privileged language when one tries to control the material resources used, the machine language and the binary data generated by the compilers being relatively predictable. This language is therefore extremely used in areas such as embedded microcontroller programming, intensive computations, writing operating systems and modules where the speed of processing is important. It is a good alternative to the assembly language in these areas, with the advantages of more expressive syntax and portability of source code. The C language was invented to write the UNIX operating system, and remains used for system programming. So the core of large operating systems like Windows and Linux are developed largely in C.

In return, the development of C programs, especially if they use complex data structures, is more difficult than with higher-level languages. Indeed, for the sake of performance, the C language requires the user to program certain processes (memory release, verification of the validity of indices on the tables ...) that are automatically supported in high-level languages .

Stripped of the convenience provided by its standard library, C is a simple language, and its compiler is too. This is reflected in the development time of a C compiler for a new processor architecture: Kernighan and Ritchie felt that it could be developed in two months because "it will be seen that 80% of the code of a new compilers are identical to those of other existing compilers. ".

3 - Qualities and defects

Qualities
The C language is one of the most used languages ​​because:
  • It has existed for a long time, the early 1970s;
  • It is based on an open standard;
  • many computer scientists know him;
  • being of the lowest portable level possible, it allows the minimization of the necessary memory allocation and the maximization of the performance, notably by the use of pointers;
  • compilers and software libraries exist on most architectures;
  • it has influenced many newer languages ​​including C ++, Java, C # and PHP; its syntax in particular is widely used;
  • it implements a limited number of concepts, which facilitates its mastery and the writing of simple and fast compilers;
  • it does not rigidly specify the behavior of the produced executable file, which helps to take advantage of the capabilities of each computer;
  • it allows the writing of software that does not need any support at runtime (neither software library nor virtual machine), the predictable behavior in runtime as in consumption of RAM, like system kernels exploitation and embedded software.

Its main disadvantages are:
  • the few checks offered by the original compilers (K & R C), and the lack of run-time checks, so that errors that could have been automatically detected during development were only execution, so at the cost of a software crash;
  • on UNIX, the lint and cflow utilities could be used to avoid such errors;
  • checks are added over time, but they are partial;
  • his approach to modularity remained at the level of what was done in the early 1970s, and largely exceeded by other languages ​​since:
  • it does not facilitate object-oriented programming;
  • it does not allow to create namespaces;
  • very basic exception handling;
  • the very limited support of genericity, despite the introduction of generic type expressions in C11;
  • the subtleties of writing portable programs, because the exact behavior of executables depends on the target computer;
  • minimal support for memory allocation and character strings, forcing programmers to deal with tedious details and sources of bugs; in particular, there is no standard crumb tray;
  • serious bugs that can be caused by a simple lack of attention of the developer; such as buffer overflow, which constitutes a computer security flaw exploitable by malware;
  • some errors can only be detected automatically using additional and non-standard tools, such as lint and Valgrind;
  • low language productivity compared to newer languages




Younes Derfoufi CRMEF OUJDA

No comments:

Post a Comment

Category Of Mobile Courses

Actualités (644) Adsense (1) Affiliation (1) Algebraic Topology (1) Algorithmic (1) all-news (30) Android (5) Android App (8) Android app without code (4) Android Apps (169) Android Development (4) Android download (2) Android OS (3) AngularJS (1) Automata theory and formal language (5) C programming (5) Category and Functor (8) CMS (3) Computer Glossary (18) Create Mobile App With Ionic Framework (2) CSS (2) CSS-Cascading-Style-Sheets (4) Developpement Java (13) Differential Geometry (1) Django-Python-Framework (8) dropshiping (26) Earn Money by Internet (4) Emplois (23) Framework php (2) Fraud (2) HTML (7) Java For Beginners (10) Javascript (12) Kotlin Programming Language (8) Kotlin For Mobile Android (1) Linux Download (2) Marketing (5) Mobile (3) Mobile Courses (4) Mobile Marketing (4) MoneyGram (1) News (721) Node.js (5) Open Source (1) Photoshop (1) Protect Computer (1) Python (33) Python BeautifulSoup (1) Python For Data Science (2) Python-Books (6) Python-DVD-Training (1) Python-Exercises (138) Python-Framework (1) Python-IDE (1) Python-Modules (1) Python-pdf (2) Python-pyQt (1) Référencement (2) Script PHP (2) Security (6) SEO (1) Snipping Tool: Faq (1) Social Networks (1) Source Code (1) Statistics With SPSS (2) Surveillance Software (1) Travail à domicile (6) Tutoriels php en vidéos (2) Tutoriels-MySql (6) tutoriels-php (19) Utilitaires (1) VPS (1) Web Hosting (1) Webcam (1) Webmarketing (11) Western Union (1) Windows 10 (1) Windows 7 (4) Windows 7 Faq (2) Windows 8 (1) Windows Accessories (1) Windows Download (8) Windows Drivers (1) Windows Fonts (1) Windows Power Shell (2) Windows Registry (2) Windows Security (18) Windows Software (2) Windows Spyware (2) Windows utilities (3) Windows Virus (2) Windows Vista (3) Windows Wireless (1) Windows xp (1) Wordpress (1)
 

Sample text

Sample Text

 
Blogger Templates