Get A Spiny Norman Shirt Get A Shameless42 Shirt Get A Tux Shirt
top pipe
Get Firefox!

C For Yourself

Introduction

Ok, I admit it, I put a pun in the name of this series as a cheap trick to get attention. That being said, I intend to make that title a reality. This series will help you to learn the C language on your own. There will be no handholding or spoon-feeding, just the presentation of facts and a healthy dose of pointers to further reading.

I've been considering the addition of a C tutorial for quite a while, but I was always concerned that I couldn't add much to the body of work that was already available. There are lots of experts who have published lots of books about how to write programs in C. How could I ever hope to top their contributions? How could I even hope to keep up with them? The answer is: I can't, so I won't

I'll give you an overview of the basic features of the language. I'll always give you enough knowledge to get you started on a subject, then point you to further information. I'll give you the benefit of my own tricks, tips, and observations, interspersed with pointers to other works that I find useful. It is up to you to follow those pointers, then come back for more.

What You Will Find Here

What you will find here is knowledge that I have accumulated over nearly 20 years of writing C code for DOS, UNIX, Windows, Linux, and various real-time and embedded operating systems (if I had an operating system available at all). I intend to stick to what you need to know, without unnecessary details that I just don't think you'll need. Of course, this will mean that what you see will be skewed toward my own experiences, but I can't help that much. If I think I have enough knowledge of a specialized subject to go off on a tangent with it, but I don't think it is something you are likely to need, I'll put it on a new page and give you a link to it. Those who are uninterested can just keep right on going without having to endure my uninteresting little excursions, while those who see a possible benefit can indulge.

What You Will Not Find Here

You will not find any hand-holding or spoon feeding. I won't go into any compiler details if I can help it. You won't find any graphics tricks, combo boxes, windows, or web programming. If you are looking for instructions like "type this, then hit the compile button", please go away, you won't be happy here.

Sample Code

I will try to keep all of the examples in this series as generic as possible. Fundamental C code really doesn't have much in the way of graphics support, so most of the I/O will be to and from the console. I'll keep things as "OS Agnostic" as I can, though there are probably times when that won't be possible. I'll let you know when that happens. I intend to supply source code that will run just as easily on Windows as Linux, and can be ported with relative ease to just about any platform

Why C?

Why would anyone want to learn C when there are so many easier alternatives available? Well, the answer to that question is not at all obvious unless you look beyond the Windows desktop that most people spend the bulk of their time working with. Though you will hear programmers praise the language of their choice for basic "business logic" or user interfaces, most languages are geared toward ease of use, security, or making it difficult for a programmer to do anything dangerous. C has none of these limitations, and none of these features. It allows unrestricted access to anything that the hardware allows, making it nearly infinitely flexible, and also extremely dangerous if used improperly. Sure there are reasons why you should learn Java and C++. Python, Pearl, and PHP all have their place as well. but if you want to get down "close to the metal", you really need to learn C.

There are still many areas of programming where C is the dominant language, and that fact seems unlikely to change in the near future. If you look at things like device drivers, kernels, microcontrollers, and network stacks, you will find that they require a specific mix of portability and performance that only C can provide. If you intend to get involved in any of these fields, you will most likely be required to learn C at a professional level.

C vs. C++

Many people, including a majority of software professionals, believe that learning C++ automatically means that you know C. That just isn't true. The two languages share a lot of common ground, but they are completely different in philosophy. One arranges itself as a collection of objects that have attributes and actions associated with them, while the other arranges itself as a collection of actions that can be performed on objects. In the end, C++ philosophy is a more natural way for the programmer to think, while C is much closer to the way the machine actually "thinks". Though C++ is essentially a superset of C (there are a few C-isms that don't work in C++), most C++ tutorials stress the "++" part as opposed to the "C" part. In my experience, I find that most C++ programmers are unprepared for C programming unless they have actually spent a significant amount of time programming strictly in C.

Next Issue: Getting Started >>
Valid XHTML 1.1!