Getting Started
Before we can begin to write serious programs in C, it would be interesting to find out what really is C, how it came into existence and how does it compare with other programming languages. In this chapter, we would briefly outline these issues.
Four important aspects of any language are -- the way it stores data, the way it operates upon this data,how it accomplishes input and output, and how it lets you control the sequence of execution of instructions in a program. We would discuss the first three of these building blocks in this chapter.
.
What is C?
C is a programming language developed at AT & T's Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. C became popular because it is reliable, simple and easy to use. In a industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than three decades has to be really good.
An opinion that is often heard today is--"C has been already superseded by languages like C++, C# and Java, so why bother to learn today". I seriously beg to differ with this opinion. There are several reasons for this. These are as follows:
(a) C++, C# or Java make use of a principle called Object Oriented Programming (OOP) to organize the program. This organizing principle has lots of advantages to offer. But even while using this organizing principle, you would still need a good hold over the language elements of C and basic Programming skills. So it makes more sense to first learn C and then migrate to C++, C# or java. though this two step learning process may take more time, but at the end of it, you will definitely find it worth the trouble.
(b) Major parts of popular operating systems like Windows, UNIX, Linux and Android are Written in C. Moreover, if one needs to write device driver programs. These Programs are written exclusively in C.
(c) Common consumer devices like microwave ovens, washing machines and digital cameras are getting smarter day by day. This smartness comes from a microprocessor, an operating system and a program embedded in these devices. These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C. With these constraints on time and space, C is the language of choice while building such operating systems and programs.
(d) You must have seen several professional 3D computer games where the user navigates some object, like say a spaceship and fires bullets at invaders. The essence of all such game has to react fast to the user inputs. This is where C language scores over other languages. Many popular gaming frameworks (like DirectX) have been built using C language.
(e) At times, one is required to very closely interact with the hardware devices. Since C provides several language elements that make this interaction feasible without compromising the performance, it is the preferred choice of the programmer.
I hope that these are very convincing reasons why you should adopt C as the first, and a very important step, in your quest for learning programming.
.
What is C?
C is a programming language developed at AT & T's Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. C became popular because it is reliable, simple and easy to use. In a industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than three decades has to be really good.
An opinion that is often heard today is--"C has been already superseded by languages like C++, C# and Java, so why bother to learn today". I seriously beg to differ with this opinion. There are several reasons for this. These are as follows:
(a) C++, C# or Java make use of a principle called Object Oriented Programming (OOP) to organize the program. This organizing principle has lots of advantages to offer. But even while using this organizing principle, you would still need a good hold over the language elements of C and basic Programming skills. So it makes more sense to first learn C and then migrate to C++, C# or java. though this two step learning process may take more time, but at the end of it, you will definitely find it worth the trouble.
(b) Major parts of popular operating systems like Windows, UNIX, Linux and Android are Written in C. Moreover, if one needs to write device driver programs. These Programs are written exclusively in C.
(c) Common consumer devices like microwave ovens, washing machines and digital cameras are getting smarter day by day. This smartness comes from a microprocessor, an operating system and a program embedded in these devices. These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C. With these constraints on time and space, C is the language of choice while building such operating systems and programs.
(d) You must have seen several professional 3D computer games where the user navigates some object, like say a spaceship and fires bullets at invaders. The essence of all such game has to react fast to the user inputs. This is where C language scores over other languages. Many popular gaming frameworks (like DirectX) have been built using C language.
(e) At times, one is required to very closely interact with the hardware devices. Since C provides several language elements that make this interaction feasible without compromising the performance, it is the preferred choice of the programmer.
I hope that these are very convincing reasons why you should adopt C as the first, and a very important step, in your quest for learning programming.