Ten Reasons to Teach and Learn Computer Programming in C
Harry H. Cheng
Writing computer programs to solve problems is a basic skill all students
There are many popular programming languages.
Students nowadays typically get exposure to more than one language.
Which computer programming language should students know
so that they will not miss fundamentals of computing?
Which computer programming language should students
learn first to gain computer-aided problem solving skills?
I started my computing career using computers with punch cards and BASIC.
Later, I learned FORTRAN 77, Fortran 90, and numerous computer
Based on my teaching, research, and industrial experiences,
the answer is C for the following reasons.
Last updated on May-30-2011
I hope you enjoyed reading this article.
You may find my other relevant article
C for the Course
C is one of the foundations for modern information technology (IT) and computer science (CS).
Many working principles of IT and CS, such as
programming languages, computer architectures, operating systems, network communication, database,
graphical user interface (GUI), graphics, image processing, parallel processing,
multi-threads, real-time systems, device drivers, data acquisition,
algorithms, numerical analysis, and computer game,
are based on or reflected in the functionalities and features of C.
The experience in C
will help students understand the working principles
of these important concepts in IT and CS.
Therefore, C is required for the CS major in almost all universities.
C is the most commonly used programming language
Academic institutions have a mission to teach technologies that are widely used in the real world so that students have the skills and knowledge that employers need. More than 90 percent of the programs running on our desktops, from operating systems and e-mail clients to Web browsers and word processors, are written in C or its relative, C++ which has extensions to C.
Most games and underlying robot control software are
written in C or C++. With the
knowledge of C, students will not only be able to play games and robots, but
also understand their underlying working principles and potentially develop
their own games and robots.
The Programming Language Popularity Web site
and Programming Community Index ( www.tiobe.com)
are two of the best known and most authoritative statistical sources.
In the Programming Language Popularity Website (dated in June, 2010), C tops the list,
C++ ranks the second, Java is the third as shown in Figure 1.
Figure 1: The popularity of different programming languages.
In the Programming Community Index (dated in June, 2010),
C and C++ together are the dominant number one (27.6%,
with C for 17.9% and C++ for 9.7%)
with a huge distance from the number two among all existing programming languages.
Java holds the second spot (18.0%).
Matlab and Fortran have much lower market shares.
Matlab ranks 15 (0.6%) and Fortran ranks 35 (0.4%)
C is the language of choice for programming embedded and mechatronic systems with hardware interfaces.
C is the language of choice for harware interface.
C allows you to access the memory of a computer or microprocessor to
manipulate and play with bits and bytes.
Device drivers of new hardware devices are typically written in C.
Often, C is the only choice and the other alternative is tedious, low-level programming using an assembly language.
Therefore, C is the de facto standard of high-level programming language for hardware interface.
As a hardware interface language, C is used commonly for data acquisition and real-time control of embedded and mechatronic systems.
C is especially useful for applications such as control of robots.
The underlying algorithms for control robots are always written in C.
Often times, users will also have to write C code to control a robot.
For example, programming robots in the FIRST Robotics Competition is typically
accomplished in C.
Many hardware and software vendors even provide libraries of C code for hardware interfaces. C is also the most widely used language for programming embedded processors, which control everything from automobiles, industrial machinery, medical equipment, and household appliances to traffic lights, vending machines, cell phones, and toys. Of the 9 billion microprocessors manufactured in 2005, 8.8 billion were embedded into products. Most of them were programmed in
C or assembly languages.
C is one of the most commonly used programming languages
in colleges and universities.
Computer programming is an essential skill for advanced studies in
Science, Technology, Engineering, and Mathematics (STEM) fields.
Like in industry, C is also
one of the most commonly used programming
languages in colleges and universities for teaching and research.
Experience indicates that the gateway courses on C or C++
in colleges are often difficult for freshman college students.
C or C++ is required by not only CS major, but also many
other majors in colleges and universities.
C or C++ is the gatekeeper for the Computer Science major in many universities.
With experience in C, students are well prepared for advanced studies
in colleges and universities.
Note that many embedded systems do not support C++.
Therefore, learning to develop programs using a strict C, without advanced C++ features,
is critical for many applications including interface to hardware.
C++ is a superset of C to a certain degree. However,
C++ is a lot more complicated than C.
Unfortunately, without a solid foundation in C,
it is impossible to fully master object-oriented and
many other advanced features in C++.
C is the base for almost all popular programming languages.
C is the language of choice for system programming.
Because of the performance and portability of C,
almost all popular cross-platform programming languages and scripting languages, such as C++, Java, Python, Objective-C, Perl, Ruby, PHP, Lua, and Bash, are implemented in C and borrowed syntaxes and functions heavily from C.
They share the similar operators, expressions, repetition statements, control structures, arrays, input and output, and functions.
Furthermore, almost all languages can interface with C and C++
to take advantage of a large volume of existing C/C++ libraries.
Many of their toolkits, modules or packages
are written using C or C++.
For example, a scripting language typically
uses wrappers around a C or C++ library to create a toolkit or package.
Any emerging popular cross-platform languages
will very likely also be written in C
and must be designed to be able to interface with existing
C excels as a model of programming languages.
C does an excellent job of illustrating the underlying working principles of
computers, scientific computing, and disciplined software development. Students gain valuable knowledge of such fundamental programming concepts as data types, internal data representations,
operators, expressions, loops for repetitions,
control structures, arrays, input and output, functions, debugging, etc.
Studying C provides a solid foundation for students who want to learn
advanced programming skills such as object-oriented programming,
event-driven programming, multi-thread programming, real-time programming, embedded programming,
network programming, parallel programming, other programming languages,
and new and emerging computing paradigms such as grid-computing and cloud computing.
Once students have learned C, they can pick up any other languages
Certain languages and tools are typically used
to solve domain specific problems.
the ability to understand and learn new languages is important.
All other modern languages borrowed heavily from C.
Once students learned C, it is easy for them
to learn by themselves any other computer languages
without much difficulty.
On the other hand, even if students have learned other programming
languages or visual programming, it is generally
still quite difficult for them
to learn C by themselves, especially for difficult topics such
as pointers and linked lists.
Computer programming in C needs a disciplined approach.
Many people believe that if students start with computer programming
using a typeless scripting language first, then they would have even
harder time to learn and master C afterwards.
C is a standardized programming language with international
The standardization encourages diverse implementation
by different vendors and organizations.
Unlike proprietary languages such as Matlab and Mathematica,
a standardized programming language is not controlled by a single vendor.
A standardized programming language is stable and its evolution is overseen by a technical standard committee made up of business, academic, and organizational representatives with a stake in the language.
The existing code written in a standardized language
is less likely to break even if compilers or interpreters
from different vendors are updated or developed years later.
This means what you learned and
wrote 30 years ago won't be obsolete and are still useful today and in the future.
The first C standard, C89, was released in 1989 by the ANSI X3J11 and ISO S22/WG14 C Standard Committees. The second (and latest) C standard, C99, was ratified in 1999 and added many new features, such as complex numbers, variable length arrays for numerical computing, and support for 64-bit computing.
All existing code conforming to the C89 standard can run in
a C compiler or interpreter conforming to the C99 standard.
As a contrary example, there is no standard for Python.
Python 3.0 breaks the code, packages and modules written for the previous versions of
Computer programming is becoming a necessary skill for many professions.
Writing computer programs is essential to solving complex science
and engineering problems.
Many principles and concepts in
STEM disciplines can be illustrated
and reinforced through writing programs. C and C++ are more widely used
in STEM fields than any other programming languages such as Java, Fortran, or Matlab.
The notion that only future computer scientists or IT professionals need training in computer programming is no longer true. Outside of the IT industry, knowledge of computer programming is an essential skills
for careers not only in STEM fields, but also in marketing, advertising, journalism and the creative arts.
For example, market researchers may have to use or write programs to
analyze a large set of data.
Computer programming can develop student's critical thinking capabilities.
Developing a program to solve a practical problem involves many
creative works, including design, logic reasoning, math, etc.
It can help students find practical applications
of many math concepts such as variables in Algebra I and trigonometry.
Debugging a program can also help student improve their
reasoning and logical thinking capabilities.
The computer-aided problem solving capabilities can be trained using C.
The article Structured Programming Education Requirements for Aerospace Engineering
(E. Allen Arrington,
49th AIAA Aerospace Sciences Meeting, Orlando, Florida, Jan. 4-7, 2011, paper number: AIAA-2011-466)
contains three-year surveys with Department Chairs,
employers, and young professionals and detailed analysis about
structured programming education requirements for aerospace engineering.
One of comments made by a young professional is that
"I have a masters degree in dynamics and controls, despite the fact that C was never emphasized. The entirety of my
education was using MATLAB. Now "in the real world" I am not asked to work on controls systems, as I do not have the C
experience that is expected. According to potential employers, this lack of object oriented programming (C and C++) education has left a glaring hole in my resume. Now, I graduated with honors, so I can only blame this lack of knowledge on my school, due to the fact that the coursework was not required for either the undergraduate or the graduate degree."
In the article
Why Software Is Eating the World published in the
Wall Street Journal,
the co-founder of NextScape, said
"many people in the U.S. and around the world lack the education
and skills required to participate in the great new companies coming out
of the software revolution. This is a tragedy since every company
I work with is absolutely starved for talent."
If you have any comments and suggestions, please feel free to