Intro to Programming With C

From FreekiWiki
Revision as of 10:56, 2 January 2010 by Kurtk (talk | contribs) (First contribution, work in progress)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is a work in progress

Contact is Kurt Krueger allez@att.net

At some time before the first class is taught, there will be useful information in this Wiki.

However, unlike the page for the Bash class, there will be no attempt to make this a web course.


Why C ?

C can be defined as the root of all evil. It was developed in the 70's for the purpose of generating neat programs. One of the neat things created was the Unix operating system, Linux is a PC port of Unix. All languages developed under Unix have their roots in C. C is still widely used in the industry.


C vs. C++

C++ was developed later in the game when the Object Oriented language craze began. The most obvious difference is that C is procedural based and C++ is object based. However, C++ was implemented as a superset of C, so the entire C language is embedded in C++ including the procedural paradigm. In many cases the language is referred to as C/C++.


Some Historic notes

In the days preceding the C language, operating systems were generally written in assembly code. This is a very low level and tedious, error prone way to write code. But since assembly code is one to one with the underlying processor's instruction set it created very fast and concise code. The coder also had full control of anything the processor could do.

About the time that C was conceived, a ground breaking computer architecture was created by Digital Equipment Company (DEC, bought by Compaq, in turn bought by HP) named the PDP-11. One of its claims to fame was a stack based instructions. The implementation of these instructions was native to the hardware. Competitor's hardware would require several instructions to accomplish the same thing. This was very important in the days where maximum computer memory was in kilobytes and clock speeds were under 1 Mhz. The PDP-11 could handle a maximum of 28K or memory.

The developers of the C language wanted something that was of a higher level, e.g. more readable and more productive. But they didn't want to lose any of the control that assembly languate