Search

C/C++ Programming Language

Updated: Mar 5

C and C++ is the first Programming Language that I learned in my college days and that most undergrad Computer Science students learn at the beginning of their programs.


If you are starting into Programming and want to build a strong foundation in Programming and Computer Science, then you should definitely go first with C/C++ language.


C and C++ is one of the most powerful and fast Programming Languages.


Therefore, C++ is widely used for game development as a small delay in game can ruin the whole gaming experience.


Reasons to Learn C/C++


C/C++ helps in making your basics and computer fundamentals crystal clear. C/C++ are the Programming Language which will help you in becoming a better programmer for sure. You will learn a lot about memory management, pointers and object- oriented programming. So, after you have learned C/C++, you will be able to learn any Programming Language. C/C++ increases your logic building ability more than any other language. It is comparatively more difficult to learn C/C++ than other languages. But once you learned it, other Programming Languages will becomes just a piece of cake for you. C/C++ have a great community support. During your learning process, you will find lots of tutorials for C/C++ very easily. C/C++ is among the most efficient and fast Programming Language. With C/C++, memory management becomes much easy. That is why most of the popular software and games are build with C/C++. Majority of the operating systems are build using C/C++. So, if you know C/C++, you will came to know much about Operating System and how it works.


REASONS WHY YOU SHOULD KEEP LEARNING C/C++


Many programmers are frustrated with and leaning away toward the C/C++ programming languages because of the following reasons:

(1) Very steep learning curve.. Many people joined the programming world by learning C or C++, but it’s rare for them to keep learning and mastering these two languages well because they get frustrated in handling the low-level programming elements such as pointers, the memory storage model, address alignment, templates expansion, multi-thread data races, and so on. If these elements are not handled properly, the app will have a high probability of crashing, which will frustrate the new programmer.

(2) Rarely used in modern application development Nowadays we have many advanced programming languages like Java, C#, Python, Javascript, Go, etc for application development and it seems insane if someone wanted to develop a Web application or backend service in pure C/C++. The common application areas have been taken over by more advanced programming languages such as:


Web front-end development: Javascript/Typescript rule everything and the three popular frameworks in frontend are Angular, React, and Vue.

Web back-end service development: Javascript (Node), Python (Flask, Django), Java, and PHP are the popular technologies used.

Desktop application development: QT (PyQT, C++), Electron (Javascript), WPF (C#).

Mobile application development: iOS (Objective-C, Swift), Android (Java).

Distributed systems, Big Data, Cloud Computing: Java, Go, Groovy, Scala.

Data science, AI (Artificial Intelligence), ML (Machine Learning): Python.


It looks like C/C++ are rarely used in these modern application development areas. So why should we still learn C/C++? Here are 5 reasons why you should:

1. Master other advanced programming languages faster. Almost all other modern programming languages and popular libraries are built by C/C++. Here are some typical examples: – Java: The core of Java Virtual Machine hotspot is implemented in C++. – Python: The Python interpreter is implemented in C. – Javascript: The most popular Javascript engine V8 is implemented in C++. – Numpy: One of the most popular scientific libraries in Python and it is widely used in AI and ML, but its core module is implemented in C. If you just remember the syntax of a programming language or can use the common libraries well, it doesn’t mean you truly mastered the programming language. Knowing the theory behind the languages can help you develop applications in the language more efficiently, which then means you truly mastered the language. But the prerequisite for all of that is you have to know C/C++ well.

2. Bring performance. When programming in the advanced programming languages, we mainly focus on the implementation of functionalities. We usually use guidelines of best practice to avoid silly mistakes but it is not nearly enough when you need to gain better performance. Better performance requires careful profiling and analysis to find out which code are the performance hot spot and how to rewrite them in a more efficient way. If you know C/C++ enough, then it will aide you in gaining a better performance because you know how these advanced programming languages run at its lowest level. You will be able to discover the issue faster which may be performance decay, the expensive CPU instructions, the cache miss, the tradeoff of context switching, or something else.

3. Understand the fundamental computer theories well. Computer networks, operating systems, computer architecture, and compiler theories are four of the most important fundamental computer theories and almost all of our new techniques are built based on these four. If you are just programming in the advanced programming languages, these machine-level details are usually hidden from you. But these techniques are really important if you want to jump out of the existing frameworks and develop something more. For example, when the network status is unstable and you need a reliable connection you would not solve the issue with TCP because TCP brings a large latency due to its large retransmission timeout. So how should you do it? If you understand a computer network well, you can build your own reliable protocol with more aggressive and efficient retransmission schemes. You would then need to integrate it into the network’s SDK and you may need to know how the network protocols are implemented in the Operating System. Your implementation should be efficient so you have to know the computer architecture well too such as using the CPU cache, memory, and network adaptors effectively. Finally, if you want to provide API interfaces for other advanced languages, like Python, Javascript etc, you need to know how the language binding works and compiler theories helps with that. Most importantly, all these key techniques are based on C/C++.

4. C/C++ powers the world C/C++ is everywhere. In particular, they power more technologies than we give it credit for.

Most operating system kernels are written in C, including but not limited to Windows, Linux, Mac, iOS, Android and so on. Modern browsers are also written in C/C++. like Chrome, Firefox etc. Modern game engines are written in C/C++, like Unity3D, Unreal Engine, cocos2d-x etc. As mentioned above, programming languages compilers and interpreters are implemented in C/C++ too. According to the TIOBE Index for March 2018, C/C++ are still the most popular languages. So don’t hesitate to keep learning these two languages that are still powering the world.

©2020 by Arturo Devesa.