In this blog post, we will look at why you should still learn C amid rapidly changing programming languages and its fundamental value.
There is a joke among computer science students. They say that our department is not actually called the Department of Computer Science, but rather the Department of Coding Slaves. This saying reflects the reality faced by computer science students with a touch of self-deprecating humor. Programming is not simply an academic subject, but a skill that requires a significant investment of time and constant practice, and this expression clearly reveals the difficulties they face. The ability to code programs is so important that it warrants such a statement.
With the advent of the 21st century, the processing speed of computers has advanced at a frightening pace. Nevertheless, computers are still just machines that operate according to commands given by humans. Therefore, the importance of giving commands to computers, or program coding, remains as significant as ever. In order to code, one must first study programming languages, of which there are many. From the most basic machine language consisting only of 0s and 1s to JAVA used for Android app development, there is a wide range of languages to choose from. Programming languages are more than just tools; they are essential for developers to exercise their creativity and solve complex problems.
Even people who are not familiar with programming languages have probably heard of C. Even I, who knew nothing about programming before entering university, knew the name C. And the first programming language I learned was C. C is a programming language developed by Dennis MacAlistair Ritchie at Bell Labs in 1972. The programming language developed by Bell Labs before C was named B, after the letter B in Bell, so C was named after the next letter in the alphabet. As of 2014, it is a 32-year-old programming language, but along with JAVA, it is one of the most widely used programming languages in the world.
There are several reasons why it is still widely used despite being over 30 years old. The biggest reason why C is still widely used in computer science is because it is very fast. In order to give commands to a computer in languages other than machine language, it is necessary to convert them into machine language that the computer can understand. However, C is unique in that it can be read directly by a computer without any special procedures. This type of language is called a native compilation language. For example, a Korean person who is fluent in Japanese can understand Korean and Japanese as soon as they hear them, but they must look up words in a dictionary and translate them when they hear English. Similarly, computers can recognize machine language and the native compiled language C immediately, but other languages must be translated into machine language by a compiler before commands can be executed. For this reason, C forms the core of modern computer systems, and its importance is unlikely to diminish anytime soon.
Its speed is a major strength, but it also has disadvantages. Unlike many modern programming languages, C does not automatically support various features for the convenience of programmers. For example, Java, a programming language widely used with C, has a variety of APIs (Application Programming Interfaces). An API is a collection of pre-written functions for programming convenience, which simplifies complex functions and makes the programmer’s work easier. However, it has the disadvantage of taking time to call and process the API. On the other hand, C requires programmers to program these tasks directly, which requires more manual work.
This characteristic of C is a big challenge in itself, but at the same time, it gives programmers more freedom. Since users can control everything themselves, they have the opportunity to deeply understand how programs work and optimize them. This is one of the reasons why C still plays an important role in computer science.
Now that you have a basic understanding of the C language, let’s look at a simple example of how to code in C.
#include
int main() {
printf(“Hello world!\n”);
return 0;
}
The code above is a program that prints the phrase “Hello world!”, which anyone who has studied C will have written at least once. The #include at the top sets the header file to be used in this program. A header file is a file that contains the syntax rules to be used in a program, and stdio.h is a header file that contains the most basic syntax. In addition, there are math.h, which contains math-related functions, and string.h, which contains string-related functions.
The second line, int main(), declares a new function. In C language, you must use functions to implement the desired behavior. At this point, you must define the form of the function’s calculation result, the function name, and the values to be input from outside when the function starts. The int at the beginning indicates that the value to be received after calculation is an integer, and main indicates the function name. The values in parentheses are values received from outside when the function starts. In this case, there are no variables to be received from outside, so they are left blank.
The curly brackets {} indicate the beginning and end of the function, and the contents of the function are written between them. Here, we are implementing the contents to output the phrase “Hello world!” and terminate the function, but you can add various functions if you want. For example, you can control the flow of the program using conditional statements and loop statements, or manage data efficiently using arrays. This is a good way to practice logical thinking necessary for solving complex problems beyond simple output programs.
In addition to what has been described above, the C language has various programming syntaxes that can be used to implement even more complex functions. With its simplicity and speed, the C language is used to implement the most basic functions of various programs. If programming is the foundation of computer engineering, then C language can be considered the foundation of programming. It is essential for computer engineering students to learn various other languages based on C language and practice using them efficiently.
Ultimately, C language is like a compass that provides basic guidance for navigating the vast ocean of computer engineering. Becoming proficient in this language goes beyond simply learning programming skills and serves as an important foundation for gaining a deep understanding of the internal workings of computers and logical thinking. In the future, many students will be able to solidify their programming fundamentals through C and go on to develop creative and innovative technologies.