C

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

C is a program language first released in 1971. It was created by Brian Kernighan and Dennis Ritchie at AT&T/Bell Laboratories and was born along with the UNIX operating system. The language has been updated since then, and the popular variant of it is ANSI C. Despite its age, it is still commonly used in modern programs.

Before C there was assembly. Between different architectures there was different Assembly. This was problematic for writing programs because you could not just transfer a program to a new machine and expect it to work, unless it was exactly the same hardware as the first machine. C was the language that filled the gap. Its code has direct translation into assembly, but it is left up to a compiler to use the correct assembly and not the programmer.

C has some of the best hallmarks of programming:

  • powerful
  • fast execution
  • scaleable

Of course though, it has problems, too:

  • Programmers must know what they are doing
    • Could create bad code which causes the program to fail or create a security risk
    • Programs must still know if the machine is big-endian or little-endian
  • Not the fastest development since each program could potentially "reinvent the wheel"
  • Some basic tasks can require many hundreds of lines of code

Despite these pitfalls once the developer has a good command of the language he/she can do some really cool programming tricks to speed up how things are done. The developer also gets a really good view of how the computer works, because at the C level you can control these powerful internal tasks.

Some of the issues with C are solved by it's descendant C++.

Personal tools