Search This Blog

Tuesday 28 June 2011

C - Review

From Wikipedia 
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. Although C was designed for implementing system software, it is also widely used for developing portable application software.
C is one of the most popular programming languages. It is widely used on many different software platforms, and there are few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which originally began as an extension to C.




From CProgramming 
Third, C is reasonably close to the machine. When you're working with pointers, bytes, and individual bits, things like optimization techniques start to make a lot more sense. There's also utility in knowing exactly how something works underneath the hood -- this helps a great deal when something you're trying to do in a higher level language seems way slower than expected, or just doesn't work at all. You also tend to get a better picture of advanced topics like exactly how networking works. A higher level language will make it a little bit simpler, but it'll be harder to understand what's going on, and when things stop working, it's much better to know exactly what's going on so you can fix it. Additionally, if you like computer science as a discipline, or just like knowing how things work learning the details of the system is great fun.  



From Crasseux
  • Before C, machine-language programmers criticized high-level languages because, with their black box approach, they shielded the user from the working details of the computer and all its facilities. C, however, was designed to give access to any level of the computer down to raw machine language, and because of this, it is perhaps the most flexible high-level language.
  • C has features that allow the programmer to organize programs in a clear, easy, logical way. For example, C allows meaningful names for variables without any loss of efficiency, yet it gives a complete freedom of programming style, including flexible ways of making decisions, and a set of flexible commands for performing tasks repetitively (forwhiledo).
  • C is succinct. It permits the creation of tidy, compact programs. This feature can be a mixed blessing, however, and the C programmer must balance simplicity and readability.
  • C allows commands that are invalid in other languages. This is no defect, but a powerful freedom which, when used with caution, makes many things possible. It does mean that there are concealed difficulties in C, but if you write carefully and thoughtfully, you can create fast, efficient programs.
  • With C, you can use every resource your computer offers. C tries to link closely with the local environment, providing facilities for gaining access to common peripherals like disk drives and printers. When new peripherals are invented, the GNU community quickly provides the ability to program them in C as well. In fact, most of the GNU project is written in C (as are many other operating systems). 
From Answers


  • Speed of the resulting application. C source code can be optimized much more than higher-level languages because the language set is relatively small and very efficient (other reasons too, discussed later). It is about as close as you can get to programming in assembly language, without programming in assembly language (if you don't know what assembly is just Google it). Heck you can even use assembly and C together!

  • That leads to a second advantage that C has which is its application in Firmware programming (hardware). That is due to its ability to use/work with assembly and communicate directly with controllers, processors and other devices.

  • C is a building bock for many other currently known languages. Look up the history of C and you will find that it has been around for some time (as programming languages go anyway). Take a look at Python for example a fully Object-Oriented High-Level programming language. It is written in C (perhaps C++ too). That tells you if you ever want to know what is going on under the hood in other languages; understanding C and how it works is essential.

  • That leads to the final advantage that I will touch on (there are no doubt others and disadvantages as well); C is a compiled language versus an interpreted language. Explained simply, this means that the code is compacted into executable instruction (in the case of windows anyway) rather than being "translated" on the fly at run time. This feature also lends heavily to the speed of C programs.
It is important to remember that each language however has its application, strengths and weaknesses. It really all boils down to what your end result goals are. Driving a Lamborghini 25 mph to and from work isn't what that car is intended for… 

Learning C is the is entry point into Programming world

No comments:

Post a Comment