Introduction
Before you jump in and start to write some programs in C Language, it would be interesting to find out what really is C, and before that we should really know what is Programming.We have covered in detail about what exactly is programming and related topics in our course “Computer Programming”. Please feel free to complete that before you proceed with this course in case if you have any questions regarding what is programming.
What is Programming?
Computer programming commonly known as programming or coding is the art of making a computer do what you want it to do. Programming in very simple terms is about writing programs. A sequence of instructions written to perform a specified task for a computer is known commonly as a Program, but is also referred to as a Software Program or even Computer Program. A computer being just hardware requires instructions to act upon. These instructions are executed in the computes CPU.Somehow over the years, for most common people consider programming as a job that pays very huge sum of salary for writing something which they don’t have a clue of. Also people have come to associate programming with mathematics, complex logic and various other complicated things, though I never quite understood that. Programming is like any other profession, which demands the required skill and knowledge to achieve your goals. However you should have the capability to understand the problem and know the way to achieve it. If you know the steps to solve the problem then it’s simple to put it into code. I’ve known some really good programmers who had zero math skills. Some people are naturally good in programming and pick it up quickly, while others not so good and quick take time. In case of the latter, they need enough patience and lot of practice to learn programming.
I am not going to go into more details on the topic Programming. So let us move onto our next question,
Why do we need Programming Languages?
Why can’t we use something like English? And the answer to this question is that:- A Computer is a dumb box, which cannot understand English.
- Computers need precise instructions and English would make a lousy programming language.
To explain the second point, English as a language is packed with full of ambiguities and it is very hard to express something in an unambiguous way using English. I hope that my statement that I have made now it-self will raise lot of questions.
Programming languages has answers to both of these problems. They are simple enough to be translated by translators known as Compilers or Interpreters which can convert these programming languages into binary code understandable by machines and these programming languages also reduce ambiguity.
There are a lot of different programming languages available and to be competitive in today’s world, you should know at least more than one.
In this course we will be learning the C Language.
What is C?
K&R C
Uses
C
can be and has been used in almost all areas of computers. Often some
people say that “C has been already super ceded by languages like C++,
C#, Java, and so on. So why bother to learn C today”. But its usages
goes onto speak of something very different. I would like to mention
that what I am referring to is not all that can be achieved using C
language.- C is often used for "system programming",
including implementing operating systems and embedded system
applications, due to a combination of desirable characteristics such as:
- Code portability and efficiency
- Ability to access specific hardware addresses
- Ability to pun types to match externally imposed data access requirements, and
- Low run-time demand on system resources.
- C can also be used for website programming using CGI as a "gateway" for information between the Web application, the server, and the browser.
- Some reasons for choosing C over interpreted languages are its speed, stability, and near-universal availability.
- One consequence of C's wide acceptance and efficiency is that compilers, libraries, and interpreters of other programming languages are often implemented in C. The primary implementations of Python (CPython), Perl 5, and PHP are all written in C.
- Due to its thin layer of abstraction and low overhead, C allows efficient implementations of algorithms and data structures, which is useful for programs that perform a lot of computations. For example, the GNU Multi-Precision Library, the GNU Scientific Library, Mathematica and MATLAB are completely or partially written in C.
- C is sometimes used as
an intermediate language by implementations of other languages. This
approach may be used for portability or convenience; by using C as an
intermediate language, it is not necessary to develop machine-specific
code generators. Some languages and compilers which have used C this way
are BitC, C++, COBOL, Eiffel, Gambit, GHC, Squeak, and Vala.
However, C was designed as a programming language, not as a compiler target language, and is thus less than ideal for use as an intermediate language. This has led to development of C-based intermediate languages such as C--. - Major parts of popular operating systems like Windows, UNIX, and Linux are written in C. This is because even today when it comes to performance, C beats everything. Most of the device driver programs are also written in C.
- The programs that are used in Mobile Phones, Microwave Oven, Washing Machine, Camcorders, Digital Cameras, TV’s are all written in C, due to the constraints of limited memory and processor speed but still requires optimal performance.
In our next article, let us start with knowing “How C Programming Works” and continue from there on.
No comments:
Post a Comment