Lesson 0: Introduction & Setup
Welcome to C is for Code. Here, you are going to learn to program: to tell a computer what to do, in no uncertain terms. You are going to do this because programming is awesome. Specifically, you are going to learn to write source code in the C programming language. But programming is also difficult, and C notoriously so for beginners.
Then why C? In a word, it is important. C is the foundation of countless pieces of software. It is everywhere. Your computer's operating system was written in C. The web browser with which you are viewing this page was written in C, or one of its many variants. It is even the foundation of many other programming languages. Learning C is like learning how to drive manual transmission. You need to do a lot of extra work, but you will have complete control. And once you learn, you never forget.
This Project
It is hard for us who have been doing this for years and years to remember what it was like in the beginning. If you have ever attended an introductory course by an obligated grad student, you have probably experienced a great deal of confusion. That is why I started this project. My goal is to help absolute beginners learn how to program from the ground-up, from someone who is both passionate about programming and teaching. I want to present you with clear explanations, and to guide you through the learning process slowly and steadily. And, should anything be remotely unclear, I encourage you to contact me. My hope is that when you reach the end, you will be well on your way to becoming a master programmer.
Needed Materials
-
A compiler. A large part of C programming is getting familiar with the compiler. All of the examples will assume you are using GCC version 4 or greater. Unfortunately, if your operating system is Windows, this may be the most challenging part of getting set-up. I recommend you take a look at Cygwin. If you are using a Linux-based operating system (like Ubuntu) or UNIX-based (like Mac OS X), you may already have GCC installed. If you are using Mac OS X, you can freely download and install the latest version of XCode. Be warned that this will take a while. Once you have finished, open the Terminal application (Applications > Utilites > Terminal) and type gcc -v. Ubuntu (or other Debian) users need only to install the gcc package. In the console, type sudo apt-get install gcc. Once finished, to verify the installation, type gcc -v.
-
A text editor. For Mac OS X users, I highly recommend MacVim or TextMate. Linux users may choose between vim or emacs, and thus begin a lifetime of misdirected aggression towards whomever chose the other.
-
Patience. Of all the things you will need to get started programming, this is perhaps the most important. You will experience times when you want to put your fist through a wall because something "just doesn't work." Even many seasoned professionals, myself included, often describe the feeling of "hammering away" at some difficult code, only to realize how simple the solution was 5 minutes after breaking down and stepping back from the problem. Having a great deal of patience will get you farther than you can understand right now.
Ready!
You should now be all set up and ready to go. Head over to the next lesson and dive in!