C/Before You Start

From Wikiversity
< C
Jump to: navigation, search

Objective[edit]

Books-aj.svg aj ashton 01f.png
  • Get an overview of C and its benefits.
  • Learn about the creation of C.
  • Learn the uses of C.
  • Learn and acquire the tools you'll need for this course.
  • Understand the need to complete the assignments.
  • Understand the need to pace yourself.
  • Have fun!

Lesson[edit]

Overview[edit]

If you have never programmed before or you want a refresher on C, then this course is for you! The C language provides a basis for understanding core programming concepts and a general feel of how the computer works. If you know how to program in C, you'll be able to transition to other C-like languages like C++, Java, and C# with relative ease. You aren't just limited to learning programming languages either, because a lot of the concepts taught in this course are associated with the field of computer science.

The Birth of C[edit]

Ken Thompson (left) with Dennis Ritchie (right, the inventor of the C programming language).

The C language didn't just happen over night. Time, people, and events were needed in order for this language to become a reality. So, how exactly did C come to its existence? In the early 1960's the idea of time-sharing became powerful. Large amounts of money and manpower were spent on programs that allowed a large number of people to access one computer from a terminal and use some of its resource, all at the same time! One computer was able to act like 100, allowing places like Universities to efficiently give its students access to a computer at a reasonable cost. Eventually, a time-sharing operating system called Multics became prominent in the time-sharing industry. Although Multics was revolutionary in some ways, it had many problems. It's code was large and complex, which meant it wasn't very efficient to modify the operating system. In the early 1970's, the people at Bell Labs got frustrated and fed up with Multics, so they decided to create their own operating system. Today, this operating system is known as Unix. It was originally written in assembly, which led to some problems, since it isn't very portable. The solution to their problem was going to be a programming language called B, but it had some problems and inefficiencies. Dennis Ritchie created a newer and better version of B that was called C; C being a lot more powerful than B. C was so powerful, that it was able to do the job and Unix was mostly rewritten in C. This allowed Unix to be ported to many different computers with relative ease. Soon C was used for other jobs, slowly becoming one of the most influential languages ever.

C's Uses[edit]

C is widely used in education, in application programs like text editors, windows based applications, in games like Quake III, in calculations like finding interest, and for sorting, maintaining and organizing large amounts of data. C programs are used in engineering applications like plotting of curves, integration, game development and many more. C has been used in very complex things also, e.g. Operating systems like GNU/Linux , Unix. Microsoft/Windows and other Unices (SunOS, FreeBSD, et al) were also written partly in C.

Tools You'll Need[edit]

A C compiler is a program that takes source code and turns it into an executable file. To learn C, you'll need a computer and operating system that has a C compiler.

As it was stated earlier, you'll need a C compiler. Generally, these can be platform specific, so they will vary in usage and performance. A list of C compilers can be found here. Each compiler has its advantages and disadvantages, for example some compilers may cost money, but you should be able to find free ones. Most popular among Compiler's is gcc (acronym of GNU Compiler Collection), it is pre-installed in Gnu/Linux, if not you can install it using your respective package manager. Many IDE's in Windows operating system uses gcc as their backend. In short IDE is Integrated Development Environment, It can be thought of as your work room, where you don't need to move away from it to do certain kind of work (i.e., You have everything integrated in it). When downloading and installing the compiler or IDE, you'll need to strictly follow its manual on how to setup and use the compiler or IDE. If it has a poor manual, it is advised to beware of it.

Attention yellow.svg Note: Some compiler support different versions of C. There's ANSI C (aka C89, C90, ISO C, etc.), C99, C11, as well as others. The most standard is ANSI C, so it's recommended that you get a ANSI C compiler.

As C became famous enough through time, it started to change from K&R C (often refereed as original version of C, which is invented by Ken Thompson and Dennis Ritchie). So American National Standards Institute (ANSI) made it standard by 1989, which was approved by International Organization for Standards (ISO) in 1990. So it is called as ANSI C (aka C89, C90, ISO C, etc..), whereas C99 is new standard which was approved in 1999 and C11 in 2011. Many C programs were written based on C89 (aka ANSI C).

After you got the compiler, you'll need a way to write to a file. Generally, any non-fancy text editor (Notepad in case of Windows or some-other similar application, don't use Microsoft Word as it isn't just a plain text editor) will do. If you have an IDE, it wouldn't hurt to use that and if you don't, stick with the text editor for now.

Now you have all the tools you need to start using C.

Assignments Are Good For You[edit]

This course provides many questions and exercises that test to see if you've understand the lesson. They are all contained with a section of the lesson called "Assignments" and are found at the end of the lesson. Although you're not required to do them, it's recommended that you complete the given assignments.

Have Fun![edit]

Finally, I would like to tell you that programming can be a lot of fun. If you have that constant urge to learn, to know more, if you are inquisitive, then learning C is not only a good experience, it is also fun. Some words of wisdom, try to pace yourself when using this course. Going too fast or too slow can reduce the will to complete this course.

Assignments[edit]

Crystal Clear app kedit.svg
  • Name a benefit gained when learning C?
  • Give a short summary on the creation of C.
  • Why was C famous irrespective of availability of other languages?
  • Where is C used? What applications use C?
  • Did you install a C compiler? If so, what's its name? Do you know how to use it?
  • Did you faithfully complete this assignment?
Sweden road sign A10.svg Completion status: Ready for testing by learners and teachers. Please begin!